public final class ExpConverter extends AbstractConverter implements tec.uom.lib.common.function.ValueSupplier<java.lang.String>
This class represents a exponential converter of limited precision. Such converter is used to create inverse of logarithmic unit.
This class is package private, instances are created using the LogConverter.inverse() method.
AbstractConverter.Pair| Modifier and Type | Field and Description |
|---|---|
private double |
base
Holds the logarithmic base.
|
private double |
logOfBase
Holds the natural logarithm of the base.
|
private static long |
serialVersionUID |
IDENTITY, PI| Constructor and Description |
|---|
ExpConverter(double base)
Creates a logarithmic converter having the specified base.
|
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
convert(java.math.BigDecimal value,
java.math.MathContext ctx) |
double |
convert(double amount) |
boolean |
equals(java.lang.Object obj) |
double |
getBase()
Returns the exponential base of this converter.
|
java.lang.String |
getValue() |
int |
hashCode() |
AbstractConverter |
inverse() |
boolean |
isLinear() |
java.lang.String |
toString() |
concatenate, concatenate, convert, getConversionSteps, isIdentityprivate static final long serialVersionUID
private final double base
private final double logOfBase
public ExpConverter(double base)
base - the logarithmic base (e.g. Math.E for the Natural Logarithm).public double getBase()
Math.E for the Natural Exponential).public AbstractConverter inverse()
inverse in interface javax.measure.UnitConverterinverse in class AbstractConverterpublic final java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class AbstractConverterpublic int hashCode()
hashCode in class AbstractConverterpublic double convert(double amount)
convert in interface javax.measure.UnitConverterconvert in class AbstractConverterpublic java.math.BigDecimal convert(java.math.BigDecimal value,
java.math.MathContext ctx)
throws java.lang.ArithmeticException
convert in class AbstractConverterjava.lang.ArithmeticExceptionpublic boolean isLinear()
isLinear in interface javax.measure.UnitConverterpublic java.lang.String getValue()
getValue in interface tec.uom.lib.common.function.ValueSupplier<java.lang.String>