public final class MultiplyConverter extends AbstractConverter implements tech.uom.lib.common.function.ValueSupplier<Double>, tech.uom.lib.common.function.DoubleFactorSupplier
This class represents a converter multiplying numeric values by a constant
scaling factor (double based).
AbstractConverter.PairconversionSteps, IDENTITY| Constructor and Description |
|---|
MultiplyConverter(double factor)
Creates a multiply converter with the specified scale factor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(javax.measure.UnitConverter o) |
BigDecimal |
convertWhenNotIdentity(BigDecimal value,
MathContext ctx)
Non-API
|
double |
convertWhenNotIdentity(double value)
Non-API
|
boolean |
equals(Object obj) |
double |
getFactor()
Returns the scale factor of this converter.
|
Double |
getValue() |
int |
hashCode() |
MultiplyConverter |
inverseWhenNotIdentity()
Non-API
|
boolean |
isIdentity() |
boolean |
isLinear() |
protected boolean |
isSimpleCompositionWith(AbstractConverter that)
Non-API
Guard for
AbstractConverter.simpleCompose(AbstractConverter) |
static MultiplyConverter |
of(double factor)
Creates a multiply converter with the specified scale factor.
|
protected AbstractConverter |
simpleCompose(AbstractConverter that)
Non-API
Guarded by
AbstractConverter.isSimpleCompositionWith(AbstractConverter) |
String |
transformationLiteral()
Non-API
|
concatenate, convert, convert, convertWhenNotIdentity, getConversionSteps, inverse, of, toStringpublic MultiplyConverter(double factor)
factor - the scaling factor.public static MultiplyConverter of(double factor)
factor - the scaling factor.public double getFactor()
getFactor in interface tech.uom.lib.common.function.DoubleFactorSupplierpublic boolean isIdentity()
isIdentity in interface javax.measure.UnitConverterprotected boolean isSimpleCompositionWith(AbstractConverter that)
AbstractConverterAbstractConverter.simpleCompose(AbstractConverter)isSimpleCompositionWith in class AbstractConverterprotected AbstractConverter simpleCompose(AbstractConverter that)
AbstractConverterAbstractConverter.isSimpleCompositionWith(AbstractConverter)simpleCompose in class AbstractConverterpublic MultiplyConverter 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 AbstractConverterpublic double convertWhenNotIdentity(double value)
AbstractConverterconvertWhenNotIdentity in class AbstractConverterpublic BigDecimal convertWhenNotIdentity(BigDecimal value, MathContext ctx) throws ArithmeticException
AbstractConverterconvertWhenNotIdentity in class AbstractConverterArithmeticExceptionpublic 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 AbstractConverterpublic boolean equals(Object obj)
equals in class AbstractConverterpublic int hashCode()
hashCode in class AbstractConverterpublic boolean isLinear()
isLinear in interface javax.measure.UnitConverterpublic Double getValue()
getValue in interface tech.uom.lib.common.function.ValueSupplier<Double>public int compareTo(javax.measure.UnitConverter o)
compareTo in interface Comparable<javax.measure.UnitConverter>Copyright © 2005–2018 Units of Measurement project. All rights reserved.