public final class LogConverter extends AbstractConverter implements tec.uom.lib.common.function.ValueSupplier<String>
This class represents a logarithmic converter of limited precision. Such converter is typically used to create logarithmic unit. For example:[code]
Unit
AbstractConverter.Pair
IDENTITY, PI
Constructor and Description |
---|
LogConverter(double base)
Returns a logarithmic converter having the specified base.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
convert(BigDecimal value,
MathContext ctx) |
double |
convert(double amount) |
boolean |
equals(Object obj) |
double |
getBase()
Returns the logarithmic base of this converter.
|
String |
getValue() |
int |
hashCode() |
AbstractConverter |
inverse() |
boolean |
isLinear() |
String |
toString() |
concatenate, concatenate, convert, getConversionSteps, isIdentity
public LogConverter(double base)
base
- the logarithmic base (e.g. Math.E
for the Natural Logarithm).public double getBase()
Math.E
for the Natural Logarithm).public AbstractConverter inverse()
inverse
in interface javax.measure.UnitConverter
inverse
in class AbstractConverter
public boolean equals(Object obj)
equals
in class AbstractConverter
public int hashCode()
hashCode
in class AbstractConverter
public double convert(double amount)
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 isLinear()
isLinear
in interface javax.measure.UnitConverter
Copyright © 2005-2018 Units of Measurement project. All Rights Reserved.