Serializable
, Comparable<Number>
, javax.measure.UnitConverter
, MultiplyConverter
, tech.uom.lib.common.function.Converter<Number,Number>
, tech.uom.lib.common.function.FactorSupplier<Number>
, tech.uom.lib.common.function.IntBaseSupplier
, tech.uom.lib.common.function.IntExponentSupplier
, tech.uom.lib.common.function.ValueSupplier<Number>
public final class PowerOfIntConverter extends AbstractConverter implements MultiplyConverter, tech.uom.lib.common.function.IntBaseSupplier, tech.uom.lib.common.function.IntExponentSupplier
AbstractConverter.Pair
conversionSteps, IDENTITY, UNIT_COMPOSITION_HANDLER
Modifier | Constructor | Description |
---|---|---|
protected |
PowerOfIntConverter(int base,
int exponent) |
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
canReduceWith(AbstractConverter that) |
Non-API
Guard for
AbstractConverter.reduce(AbstractConverter) |
int |
compareTo(javax.measure.UnitConverter o) |
|
protected Number |
convertWhenNotIdentity(Number value) |
Non-API
|
boolean |
equals(Object obj) |
|
int |
getBase() |
|
int |
getExponent() |
|
Number |
getValue() |
|
int |
hashCode() |
|
AbstractConverter |
inverseWhenNotIdentity() |
Non-API
|
boolean |
isIdentity() |
|
protected AbstractConverter |
reduce(AbstractConverter that) |
Non-API
Guarded by
AbstractConverter.canReduceWith(AbstractConverter) |
RationalConverter |
toRationalConverter() |
|
String |
transformationLiteral() |
Non-API
|
concatenate, convert, convert, getConversionSteps, inverse, toString
getFactor, identity, isLinear, of, of, ofExponent, ofPiExponent, ofPrefix, ofRational, ofRational, ofRational, ofTenExponent
protected PowerOfIntConverter(int base, int exponent)
public int getBase()
getBase
in interface tech.uom.lib.common.function.IntBaseSupplier
public int getExponent()
getExponent
in interface tech.uom.lib.common.function.IntExponentSupplier
public boolean isIdentity()
isIdentity
in interface javax.measure.UnitConverter
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 converterprotected AbstractConverter reduce(AbstractConverter that)
AbstractConverter
AbstractConverter.canReduceWith(AbstractConverter)
reduce
in class AbstractConverter
public AbstractConverter 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 final 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
public int compareTo(javax.measure.UnitConverter o)
compareTo
in interface Comparable<Number>
public int hashCode()
hashCode
in class AbstractConverter
public RationalConverter toRationalConverter()
Copyright © 2005–2020 Units of Measurement project. All rights reserved.