public static final class AbstractConverter.Pair extends AbstractConverter implements Serializable
[pair] = [left] x [right]).AbstractConverter.PairconversionSteps, IDENTITY, UNIT_COMPOSITION_HANDLER| Constructor and Description |
|---|
Pair(javax.measure.UnitConverter left,
javax.measure.UnitConverter right)
Creates a pair converter resulting from the combined transformation of the
specified converters.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canReduceWith(AbstractConverter that)
Non-API
Guard for
AbstractConverter.reduce(AbstractConverter) |
int |
compareTo(javax.measure.UnitConverter obj) |
protected Number |
convertWhenNotIdentity(Number value)
Non-API
|
protected List<? extends javax.measure.UnitConverter> |
createConversionSteps() |
boolean |
equals(Object obj) |
javax.measure.UnitConverter |
getLeft() |
javax.measure.UnitConverter |
getRight() |
int |
hashCode() |
AbstractConverter.Pair |
inverseWhenNotIdentity()
Non-API
Returns an AbstractConverter that represents the inverse transformation of this converter,
for cases where the transformation is not the identity transformation.
|
boolean |
isIdentity() |
boolean |
isLinear() |
Optional<Number> |
linearFactor()
Even though transformations may be composed of addition and multiplication, the first
derivative might just be a linear function.
|
protected String |
transformationLiteral()
Non-API
Returns a String describing the transformation that is represented by this converter.
|
concatenate, convert, convert, getConversionSteps, inverse, reduce, toStringpublic Pair(javax.measure.UnitConverter left, javax.measure.UnitConverter right)
left - the left converter, not null.right - the right converter.IllegalArgumentException - if either the left or right converter are nullpublic boolean isLinear()
isLinear in interface javax.measure.UnitConverterpublic Optional<Number> linearFactor()
AbstractConverterlinearFactor in class AbstractConverterpublic boolean isIdentity()
isIdentity in interface javax.measure.UnitConverterprotected List<? extends javax.measure.UnitConverter> createConversionSteps()
public AbstractConverter.Pair inverseWhenNotIdentity()
AbstractConverterReturns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation.
inverseWhenNotIdentity in class AbstractConverterprotected Number convertWhenNotIdentity(Number value)
AbstractConverterconvertWhenNotIdentity in class AbstractConverterpublic boolean equals(Object obj)
equals in class AbstractConverterpublic int hashCode()
hashCode in class AbstractConverterpublic javax.measure.UnitConverter getLeft()
public javax.measure.UnitConverter getRight()
public int compareTo(javax.measure.UnitConverter obj)
compareTo in interface Comparable<javax.measure.UnitConverter>protected String transformationLiteral()
AbstractConverter
Returns a String describing the transformation that is represented by this converter.
Contributes to converter's toString method. If null or empty
toString output becomes simplified.
transformationLiteral in class AbstractConverterprotected boolean canReduceWith(AbstractConverter that)
AbstractConverterAbstractConverter.reduce(AbstractConverter)canReduceWith in class AbstractConverterthat is possible, such
that no additional conversion steps are required, with respect to the steps already
in place by this converterCopyright © 2005–2022 Units of Measurement project. All rights reserved.