public final class MultiplyConverter extends AbstractConverter implements tec.uom.lib.common.function.ValueSupplier<Double>, tec.uom.lib.common.function.DoubleFactorSupplier
This class represents a converter multiplying numeric values by a constant scaling factor (double
based).
AbstractConverter.Pair
IDENTITY, PI
Constructor and Description |
---|
MultiplyConverter(double factor)
Creates a multiply converter with the specified scale factor.
|
Modifier and Type | Method and Description |
---|---|
javax.measure.UnitConverter |
concatenate(javax.measure.UnitConverter converter) |
BigDecimal |
convert(BigDecimal value,
MathContext ctx) |
double |
convert(double value) |
boolean |
equals(Object obj) |
double |
getFactor()
Returns the scale factor of this converter.
|
Double |
getValue() |
int |
hashCode() |
MultiplyConverter |
inverse() |
boolean |
isLinear() |
String |
toString() |
concatenate, convert, getConversionSteps, isIdentity
public MultiplyConverter(double factor)
factor
- the scaling factor.IllegalArgumentException
- if coefficient is 1.0
(would result in identity converter)public double getFactor()
getFactor
in interface tec.uom.lib.common.function.DoubleFactorSupplier
public javax.measure.UnitConverter concatenate(javax.measure.UnitConverter converter)
concatenate
in interface javax.measure.UnitConverter
concatenate
in class AbstractConverter
public MultiplyConverter inverse()
inverse
in interface javax.measure.UnitConverter
inverse
in class AbstractConverter
public double convert(double value)
convert
in interface javax.measure.UnitConverter
convert
in class AbstractConverter
public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException
convert
in class AbstractConverter
ArithmeticException
public boolean equals(Object obj)
equals
in class AbstractConverter
public int hashCode()
hashCode
in class AbstractConverter
public boolean isLinear()
isLinear
in interface javax.measure.UnitConverter
Copyright © 2005-2018 Units of Measurement project. All Rights Reserved.