Serializable
, Comparable<javax.measure.UnitConverter>
public static final class AbstractConverter.Pair extends AbstractConverter implements Serializable
[pair] = [left] x [right]
).AbstractConverter.Pair
conversionSteps, 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() |
|
protected String |
transformationLiteral() |
Non-API
|
concatenate, convert, convert, getConversionSteps, inverse, reduce, toString
public 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 boolean isIdentity()
protected List<? extends javax.measure.UnitConverter> createConversionSteps()
public AbstractConverter.Pair inverseWhenNotIdentity()
AbstractConverter
Returns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation.
inverseWhenNotIdentity
in class AbstractConverter
protected Number convertWhenNotIdentity(Number value)
AbstractConverter
convertWhenNotIdentity
in class AbstractConverter
public boolean equals(Object obj)
equals
in class AbstractConverter
public int hashCode()
hashCode
in class AbstractConverter
public 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 AbstractConverter
protected boolean canReduceWith(AbstractConverter that)
AbstractConverter
AbstractConverter.reduce(AbstractConverter)
canReduceWith
in class AbstractConverter
that
is possible, such
that no additional conversion steps are required, with respect to the steps already
in place by this converterCopyright © 2005–2020 Units of Measurement project. All rights reserved.