Package org.openjdk.jmc.common.unit
Class LongPostOffsetTransform
- java.lang.Object
 - 
- org.openjdk.jmc.common.unit.LongPostOffsetTransform
 
 
- 
- All Implemented Interfaces:
 IScalarAffineTransform
public class LongPostOffsetTransform extends Object implements IScalarAffineTransform
IScalarAffineTransformused as the inverse ofLongPreOffsetTransformto avoid losing the precision of the long offset. Otherwise similar toSimpleAffineTransform. 
- 
- 
Constructor Summary
Constructors Constructor Description LongPostOffsetTransform(double multiplier, long offset) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IScalarAffineTransformconcat(IScalarAffineTransform innerTransform)Concatenate this transform withinnerTransform, such that applying the resulting transform is equivalent to first applyinginnerTransformand then applying this transform on the resulting value.booleanequals(Object other)doublegetMultiplier()NumbergetOffset()inthashCode()IScalarAffineTransforminvert()IScalarAffineTransforminvertAndConcat(IScalarAffineTransform innerTransform)Concatenate the inverse of this transform withinnerTransform, such that applying the resulting transform is equivalent to first applyinginnerTransformand then applying this inverse of this transform on the resulting value.booleanisInteger()booleanisUnity()doubletargetFloor(double srcNumericalValue)longtargetFloor(long srcNumericalValue)inttargetIntFloor(Number srcNumericalValue)NumbertargetNumber(long srcNumericalValue)NumbertargetNumber(Number srcNumericalValue)booleantargetOutOfRange(double srcNumericalValue, long maxAbsValue)booleantargetOutOfRange(long srcNumericalValue, long maxAbsValue)doubletargetValue(double srcNumericalValue)longtargetValue(long srcNumericalValue) 
 - 
 
- 
- 
Method Detail
- 
getOffset
public Number getOffset()
- Specified by:
 getOffsetin interfaceIScalarAffineTransform- Returns:
 - the offset to be added (after the source value has been multiplied with the
         
multiplier) 
 
- 
getMultiplier
public double getMultiplier()
- Specified by:
 getMultiplierin interfaceIScalarAffineTransform- Returns:
 - the multiplier which source values should be multiplied with (before the
         
offsetis added) 
 
- 
targetOutOfRange
public boolean targetOutOfRange(long srcNumericalValue, long maxAbsValue)- Specified by:
 targetOutOfRangein interfaceIScalarAffineTransform
 
- 
targetOutOfRange
public boolean targetOutOfRange(double srcNumericalValue, long maxAbsValue)- Specified by:
 targetOutOfRangein interfaceIScalarAffineTransform
 
- 
targetValue
public long targetValue(long srcNumericalValue)
- Specified by:
 targetValuein interfaceIScalarAffineTransform- 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:
 targetFloorin interfaceIScalarAffineTransform- 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 
 
- 
targetFloor
public double targetFloor(double srcNumericalValue)
- Specified by:
 targetFloorin interfaceIScalarAffineTransform- 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
 
 
- 
targetIntFloor
public int targetIntFloor(Number srcNumericalValue)
- Specified by:
 targetIntFloorin interfaceIScalarAffineTransform- 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 an 
int 
 
- 
targetNumber
public Number targetNumber(long srcNumericalValue)
- Specified by:
 targetNumberin interfaceIScalarAffineTransform- 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 
 
- 
targetNumber
public Number targetNumber(Number srcNumericalValue)
- Specified by:
 targetNumberin interfaceIScalarAffineTransform- Parameters:
 srcNumericalValue- an exact or inexact 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 
 
- 
targetValue
public double targetValue(double srcNumericalValue)
- Specified by:
 targetValuein interfaceIScalarAffineTransform- 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 IScalarAffineTransform invert()
- Specified by:
 invertin interfaceIScalarAffineTransform- Returns:
 - the inverse transform
 
 
- 
isUnity
public boolean isUnity()
- Specified by:
 isUnityin interfaceIScalarAffineTransform- Returns:
 - true iff this represents the identity transform
 
 
- 
isInteger
public boolean isInteger()
- Specified by:
 isIntegerin interfaceIScalarAffineTransform- Returns:
 - true iff this transform can exactly be described by an integer multiplier followed by an integer offset
 
 
- 
concat
public IScalarAffineTransform concat(IScalarAffineTransform innerTransform)
Description copied from interface:IScalarAffineTransformConcatenate this transform withinnerTransform, such that applying the resulting transform is equivalent to first applyinginnerTransformand then applying this transform on the resulting value. That is, R(v) = T(I(v)), where R(v) is the resulting transform, T(v) is this transform, and I(v) isinnerTransform.In this snippet,
v1andv2should be equal, apart from numerical precision, for anyv.IScalarAffineTransform R, T = ..., I = ...; double v = ...; R = T.concat(I); double v1 = R.targetValue(v); double v2 = T.targetValue(I.targetValue(v));
- Specified by:
 concatin interfaceIScalarAffineTransform- Parameters:
 innerTransform- the transform that should be applied before this transform- Returns:
 - the concatenated transform
 
 
- 
invertAndConcat
public IScalarAffineTransform invertAndConcat(IScalarAffineTransform innerTransform)
Description copied from interface:IScalarAffineTransformConcatenate the inverse of this transform withinnerTransform, such that applying the resulting transform is equivalent to first applyinginnerTransformand then applying this inverse of this transform on the resulting value. That is, R(v) = T-1(I(v)), where R(v) is the resulting transform, T-1(v) is the inverse of this transform, and I(v) isinnerTransform.In this snippet,
v1andv2should be equal, apart from numerical precision, for anyv.IScalarAffineTransform R, T = ..., I = ...; double v = ...; R = T.invertAndConcat(I); double v1 = R.targetValue(v); double v2 = T.invert().targetValue(I.targetValue(v));
- Specified by:
 invertAndConcatin interfaceIScalarAffineTransform- Parameters:
 innerTransform- the transform that should be applied before this transform- Returns:
 - the concatenated transform
 
 
 - 
 
 -