Class LongScaleFactor

    • Field Detail

      • longMultiplier

        private final long longMultiplier
    • Constructor Detail

      • LongScaleFactor

        public LongScaleFactor​(long factor)
    • Method Detail

      • targetOutOfRange

        public boolean targetOutOfRange​(double srcNumericalValue,
                                        long maxAbsValue)
      • 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
      • targetOutOfRange

        public boolean targetOutOfRange​(long 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
      • targetNumber

        public java.lang.Number targetNumber​(long srcNumericalValue)
        Specified by:
        targetNumber in interface IScalarAffineTransform
        Overrides:
        targetNumber in class ScaleFactor
        Parameters:
        srcNumericalValue - an exact numerical quantity value, expressed in the source unit
        Returns:
        the corresponding numerical quantity value, when expressed in the target unit, as a Long if it can exactly be represented in one, otherwise as some other Number with at least the precision of double
      • 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
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in class ScaleFactor
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getMultiplier

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