Class BinaryScaleFactor

    • Field Detail

      • powerOf2

        protected final int powerOf2
    • Method Detail

      • getFloor1024Factor

        public static BinaryScaleFactor getFloor1024Factor​(double value)
      • getMultiplier

        public double getMultiplier()
        Returns:
        the multiplier which source values should be multiplied with (before the offset is added)
      • asExponentialStringBuilder

        public StringBuilder asExponentialStringBuilder​(boolean multiplicationSign)
      • targetOutOfRange

        public boolean targetOutOfRange​(long srcNumericalValue,
                                        long maxAbsValue)
      • targetOutOfRange

        public boolean targetOutOfRange​(double srcNumericalValue,
                                        long maxAbsValue)
      • targetValue

        public long targetValue​(long srcNumericalValue)
        Parameters:
        srcNumericalValue - a numerical quantity value, expressed in the source unit
        Returns:
        the corresponding numerical quantity value, when expressed in the target unit, rounded to the closest integer that can be represented by a long
      • targetFloor

        public long targetFloor​(long srcNumericalValue)
        Parameters:
        srcNumericalValue - a numerical quantity value, expressed in the source unit
        Returns:
        the floor of the corresponding numerical quantity value, when expressed in the target unit, clamped to a long
      • targetValue

        public double targetValue​(double srcNumericalValue)
        Parameters:
        srcNumericalValue - a numerical quantity value, expressed in the source unit
        Returns:
        the corresponding numerical quantity value, when expressed in the target unit
      • isUnity

        public boolean isUnity()
        Returns:
        true iff this represents the identity transform
      • isInteger

        public boolean isInteger()
        Returns:
        true iff this transform can exactly be described by an integer multiplier followed by an integer offset