Package org.openjdk.jmc.common.unit
Class LongScaleFactor
- java.lang.Object
- 
- org.openjdk.jmc.common.unit.ScaleFactor
- 
- org.openjdk.jmc.common.unit.LongScaleFactor
 
 
- 
- All Implemented Interfaces:
- Comparable<ScaleFactor>,- IScalarAffineTransform
 
 public class LongScaleFactor extends ScaleFactor Short termScaleFactorimplementation to improve custom units.
- 
- 
Constructor SummaryConstructors Constructor Description LongScaleFactor(long factor)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ScaleFactorconcat(ScaleFactor innerFactor)Concatenate (that is, multiply) this scale factor withinnerFactor.booleanequals(Object other)doublegetMultiplier()inthashCode()ScaleFactorinvert()ScaleFactorinvertAndConcat(ScaleFactor innerFactor)Concatenate (that is, multiply) the inverse of this scale factor withinnerFactor.booleanisInteger()booleanisUnity()longtargetFloor(long srcNumericalValue)NumbertargetNumber(long srcNumericalValue)booleantargetOutOfRange(double srcNumericalValue, long maxAbsValue)booleantargetOutOfRange(long srcNumericalValue, long maxAbsValue)doubletargetValue(double srcNumericalValue)longtargetValue(long srcNumericalValue)StringtoString()- 
Methods inherited from class org.openjdk.jmc.common.unit.ScaleFactorcompareTo, concat, getOffset, invertAndConcat, targetFloor, targetIntFloor, targetNumber
 
- 
 
- 
- 
- 
Method Detail- 
concatpublic ScaleFactor concat(ScaleFactor innerFactor) Description copied from class:ScaleFactorConcatenate (that is, multiply) this scale factor withinnerFactor. This is just a special case ofScaleFactor.concat(IScalarAffineTransform).- Specified by:
- concatin class- ScaleFactor
- Returns:
- the combined scale factor
- See Also:
- ScaleFactor.concat(IScalarAffineTransform)
 
 - 
invertAndConcatpublic ScaleFactor invertAndConcat(ScaleFactor innerFactor) Description copied from class:ScaleFactorConcatenate (that is, multiply) the inverse of this scale factor withinnerFactor. This is just a special case ofScaleFactor.invertAndConcat(IScalarAffineTransform).- Overrides:
- invertAndConcatin class- ScaleFactor
- Returns:
- the combined scale factor
- See Also:
- ScaleFactor.invertAndConcat(IScalarAffineTransform)
 
 - 
invertpublic ScaleFactor invert() - Specified by:
- invertin interface- IScalarAffineTransform
- Specified by:
- invertin class- ScaleFactor
- Returns:
- the inverse transform
 
 - 
targetOutOfRangepublic boolean targetOutOfRange(double srcNumericalValue, long maxAbsValue)
 - 
targetValuepublic 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
 
 - 
targetOutOfRangepublic boolean targetOutOfRange(long srcNumericalValue, long maxAbsValue)
 - 
targetValuepublic 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
 
 - 
targetFloorpublic 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
 
 - 
targetNumberpublic Number targetNumber(long srcNumericalValue) - Specified by:
- targetNumberin interface- IScalarAffineTransform
- Overrides:
- targetNumberin 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
         Longif it can exactly be represented in one, otherwise as some otherNumberwith at least the precision ofdouble
 
 - 
isUnitypublic boolean isUnity() - Returns:
- true iff this represents the identity transform
 
 - 
isIntegerpublic boolean isInteger() - Returns:
- true iff this transform can exactly be described by an integer multiplier followed by an integer offset
 
 - 
equalspublic boolean equals(Object other) - Specified by:
- equalsin class- ScaleFactor
 
 - 
hashCodepublic int hashCode() - Specified by:
- hashCodein class- ScaleFactor
 
 - 
getMultiplierpublic double getMultiplier() - Returns:
- the multiplier which source values should be multiplied with (before the
         offsetis added)
 
 
- 
 
-