Package org.openjdk.jmc.common.unit
Class BinaryScaleFactor.Unity
- java.lang.Object
-
- org.openjdk.jmc.common.unit.ScaleFactor
-
- org.openjdk.jmc.common.unit.BinaryScaleFactor
-
- org.openjdk.jmc.common.unit.BinaryScaleFactor.Unity
-
- All Implemented Interfaces:
java.lang.Comparable<ScaleFactor>
,IScalarAffineTransform
- Enclosing class:
- BinaryScaleFactor
private static class BinaryScaleFactor.Unity extends BinaryScaleFactor
-
-
Field Summary
-
Fields inherited from class org.openjdk.jmc.common.unit.BinaryScaleFactor
powerOf2
-
-
Constructor Summary
Constructors Constructor Description Unity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BinaryScaleFactor
invert()
long
targetFloor(long srcNumericalValue)
boolean
targetOutOfRange(long srcNumericalValue, long maxAbsValue)
double
targetValue(double srcNumericalValue)
long
targetValue(long srcNumericalValue)
-
Methods inherited from class org.openjdk.jmc.common.unit.BinaryScaleFactor
asExponentialStringBuilder, compareTo, concat, equals, get, getFloor1024Factor, getFloor2Factor, getMultiplier, hashCode, isInteger, isUnity, targetOutOfRange
-
Methods inherited from class org.openjdk.jmc.common.unit.ScaleFactor
concat, getOffset, invertAndConcat, invertAndConcat, targetFloor, targetIntFloor, targetNumber, targetNumber
-
-
-
-
Method Detail
-
targetOutOfRange
public boolean targetOutOfRange(long srcNumericalValue, long maxAbsValue)
- Specified by:
targetOutOfRange
in interfaceIScalarAffineTransform
- Overrides:
targetOutOfRange
in classBinaryScaleFactor
-
targetValue
public long targetValue(long srcNumericalValue)
- Specified by:
targetValue
in interfaceIScalarAffineTransform
- Overrides:
targetValue
in classBinaryScaleFactor
- 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)
- Specified by:
targetFloor
in interfaceIScalarAffineTransform
- Overrides:
targetFloor
in classBinaryScaleFactor
- 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)
- Specified by:
targetValue
in interfaceIScalarAffineTransform
- Overrides:
targetValue
in classBinaryScaleFactor
- Parameters:
srcNumericalValue
- a numerical quantity value, expressed in the source unit- Returns:
- the corresponding numerical quantity value, when expressed in the target unit
-
invert
public BinaryScaleFactor invert()
- Specified by:
invert
in interfaceIScalarAffineTransform
- Overrides:
invert
in classBinaryScaleFactor
- Returns:
- the inverse transform
-
-