Package tech.units.indriya
Class AbstractConverter.Identity
java.lang.Object
tech.units.indriya.AbstractConverter
tech.units.indriya.AbstractConverter.Identity
- All Implemented Interfaces:
Serializable,Comparable<javax.measure.UnitConverter>,javax.measure.UnitConverter
- Enclosing class:
AbstractConverter
This class represents the identity converter (singleton).
-
Nested Class Summary
Nested classes/interfaces inherited from class tech.units.indriya.AbstractConverter
AbstractConverter.Pair -
Field Summary
FieldsFields inherited from class tech.units.indriya.AbstractConverter
conversionSteps, IDENTITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(javax.measure.UnitConverter o) doubleconvertWhenNotIdentity(double value) Non-APIconvertWhenNotIdentity(BigDecimal value, MathContext ctx) Non-APIconvertWhenNotIdentity(BigInteger value, MathContext ctx) Non-APIbooleaninthashCode()protected AbstractConverterNon-APIbooleanbooleanisLinear()protected booleanNon-API Guard forAbstractConverter.simpleCompose(AbstractConverter)protected AbstractConverterNon-API Guarded byAbstractConverter.isSimpleCompositionWith(AbstractConverter)protected StringNon-APIMethods inherited from class tech.units.indriya.AbstractConverter
concatenate, convert, convert, getConversionSteps, inverse, of, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
Identity
private Identity()
-
-
Method Details
-
isIdentity
public boolean isIdentity() -
convertWhenNotIdentity
public double convertWhenNotIdentity(double value) Description copied from class:AbstractConverterNon-API- Specified by:
convertWhenNotIdentityin classAbstractConverter- Parameters:
value-- Returns:
- transformed value
-
convertWhenNotIdentity
Description copied from class:AbstractConverterNon-API- Overrides:
convertWhenNotIdentityin classAbstractConverter- Parameters:
value-ctx-- Returns:
- transformed value (most likely a BigInteger or BigDecimal)
-
convertWhenNotIdentity
Description copied from class:AbstractConverterNon-API- Specified by:
convertWhenNotIdentityin classAbstractConverter- Parameters:
value-ctx-- Returns:
- transformed value
-
equals
- Specified by:
equalsin classAbstractConverter
-
hashCode
public int hashCode()- Specified by:
hashCodein classAbstractConverter
-
isLinear
public boolean isLinear() -
compareTo
public int compareTo(javax.measure.UnitConverter o) -
isSimpleCompositionWith
Description copied from class:AbstractConverterNon-API Guard forAbstractConverter.simpleCompose(AbstractConverter)- Specified by:
isSimpleCompositionWithin classAbstractConverter- Parameters:
that-- Returns:
- whether or not a 'simple' composition of transformations is possible
-
simpleCompose
Description copied from class:AbstractConverterNon-API Guarded byAbstractConverter.isSimpleCompositionWith(AbstractConverter)- Overrides:
simpleComposein classAbstractConverter- Parameters:
that-- Returns:
- a new AbstractConverter that adds no additional conversion step
-
inverseWhenNotIdentity
Description copied from class:AbstractConverterNon-APIReturns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation.
- Specified by:
inverseWhenNotIdentityin classAbstractConverter- Returns:
-
transformationLiteral
Description copied from class:AbstractConverterNon-APIReturns a String describing the transformation that is represented by this converter. Contributes to converter's
toStringmethod. If null or emptytoStringoutput becomes simplified.- Specified by:
transformationLiteralin classAbstractConverter- Returns:
-