public abstract class ScaleFactor extends Object implements IScalarAffineTransform, Comparable<ScaleFactor>
Note: This class has a natural ordering that is inconsistent with equals
.
(This is because in a certain subclass, ImpreciseScaleFactor
, different instances may
express the same scale factor with different precision.)
Constructor and Description |
---|
ScaleFactor() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ScaleFactor other) |
IScalarAffineTransform |
concat(IScalarAffineTransform innerTransform)
Concatenate this transform with
innerTransform , such that applying the resulting
transform is equivalent to first applying innerTransform and then applying this
transform on the resulting value. |
abstract ScaleFactor |
concat(ScaleFactor innerFactor)
Concatenate (that is, multiply) this scale factor with
innerFactor . |
abstract boolean |
equals(Object obj) |
Number |
getOffset() |
abstract int |
hashCode() |
abstract ScaleFactor |
invert() |
IScalarAffineTransform |
invertAndConcat(IScalarAffineTransform innerTransform)
Concatenate the inverse of this transform with
innerTransform , such that applying the
resulting transform is equivalent to first applying innerTransform and then applying
this inverse of this transform on the resulting value. |
ScaleFactor |
invertAndConcat(ScaleFactor innerFactor)
Concatenate (that is, multiply) the inverse of this scale factor with
innerFactor . |
double |
targetFloor(double srcNumericalValue) |
int |
targetIntFloor(Number srcNumericalValue) |
Number |
targetNumber(long srcNumericalValue) |
Number |
targetNumber(Number srcNumericalValue) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getMultiplier, isInteger, isUnity, targetFloor, targetOutOfRange, targetOutOfRange, targetValue, targetValue
public final IScalarAffineTransform concat(IScalarAffineTransform innerTransform)
IScalarAffineTransform
innerTransform
, such that applying the resulting
transform is equivalent to first applying innerTransform
and 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) is innerTransform
.
In this snippet, v1
and v2
should be equal, apart from numerical precision,
for any v
.
IScalarAffineTransform R, T = ..., I = ...; double v = ...; R = T.concat(I); double v1 = R.targetValue(v); double v2 = T.targetValue(I.targetValue(v));
concat
in interface IScalarAffineTransform
innerTransform
- the transform that should be applied before this transformpublic abstract ScaleFactor concat(ScaleFactor innerFactor)
innerFactor
. This is just a
special case of concat(IScalarAffineTransform)
.concat(IScalarAffineTransform)
public final IScalarAffineTransform invertAndConcat(IScalarAffineTransform innerTransform)
IScalarAffineTransform
innerTransform
, such that applying the
resulting transform is equivalent to first applying innerTransform
and 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) is innerTransform
.
In this snippet, v1
and v2
should be equal, apart from numerical precision,
for any v
.
IScalarAffineTransform R, T = ..., I = ...; double v = ...; R = T.invertAndConcat(I); double v1 = R.targetValue(v); double v2 = T.invert().targetValue(I.targetValue(v));
invertAndConcat
in interface IScalarAffineTransform
innerTransform
- the transform that should be applied before this transformpublic ScaleFactor invertAndConcat(ScaleFactor innerFactor)
innerFactor
.
This is just a special case of invertAndConcat(IScalarAffineTransform)
.invertAndConcat(IScalarAffineTransform)
public abstract ScaleFactor invert()
invert
in interface IScalarAffineTransform
public final Number getOffset()
getOffset
in interface IScalarAffineTransform
multiplier
)public double targetFloor(double srcNumericalValue)
targetFloor
in interface IScalarAffineTransform
srcNumericalValue
- a numerical quantity value, expressed in the source unitpublic int targetIntFloor(Number srcNumericalValue)
targetIntFloor
in interface IScalarAffineTransform
srcNumericalValue
- a numerical quantity value, expressed in the source unitint
public Number targetNumber(long srcNumericalValue)
targetNumber
in interface IScalarAffineTransform
srcNumericalValue
- an exact numerical quantity value, expressed in the source unitLong
if it can exactly be represented in one, otherwise as some other
Number
with at least the precision of double
public Number targetNumber(Number srcNumericalValue)
targetNumber
in interface IScalarAffineTransform
srcNumericalValue
- an exact or inexact numerical quantity value, expressed in the source unitLong
if it can exactly be represented in one, otherwise as some other
Number
with at least the precision of double
public int compareTo(ScaleFactor other)
compareTo
in interface Comparable<ScaleFactor>
Copyright © 2020. All rights reserved.