Serializable, Comparable<javax.measure.UnitConverter>public static final class AbstractConverter.Pair extends AbstractConverter implements Serializable
[pair] = [left] x [right]).AbstractConverter.PairconversionSteps, IDENTITY, UNIT_COMPOSITION_HANDLER| Constructor | 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 | 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
|
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
|
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()
public Optional<Number> linearFactor()
AbstractConverterlinearFactor in class AbstractConverterpublic boolean isIdentity()
protected 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–2023 Units of Measurement project. All rights reserved.