javax.measure.converter
public final class LogConverter extends UnitConverter
Unit<Dimensionless> BEL = Unit.ONE.transform(new LogConverter(10).inverse());Instances of this class are immutable.
IDENTITY| Constructor and Description |
|---|
LogConverter(double base)
Creates a logarithmic converter having the specified base.
|
| Modifier and Type | Method and Description |
|---|---|
double |
convert(double amount)
Converts a double value.
|
double |
getBase()
Returns the logarithmic base of this converter.
|
UnitConverter |
inverse()
Returns the inverse of this converter.
|
boolean |
isLinear()
Indicates if this converter is linear.
|
concatenate, equals, hashCodepublic 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 UnitConverter inverse()
UnitConverterx is a valid value, then
x == inverse().convert(convert(x)) to within the accuracy of computer arithmetic.inverse in class UnitConverterpublic double convert(double amount)
UnitConverterconvert in class UnitConverteramount - the numeric value to convert.public boolean isLinear()
UnitConverterconvert(u + v) == convert(u) + convert(v) and convert(r * u) == r * convert(u). For
linear converters the following property always hold:[code] y1 = c1.convert(x1); y2 = c2.convert(x2); then y1*y2
= c1.concatenate(c2).convert(x1*x2)[/code]isLinear in class UnitConvertertrue if this converter is linear; false otherwise.