Serializable, Comparable<String>, tech.uom.lib.common.function.ValueSupplier<String>public final class LogConverter extends AbstractConverter implements tech.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:
Unit<Dimensionless> BEL = Unit.ONE.transform(new LogConverter(10).inverse());
AbstractConverter.PairconversionSteps, IDENTITY, UNIT_COMPOSITION_HANDLER| Constructor | Description |
|---|---|
LogConverter(double base) |
Returns a logarithmic converter having the specified base.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
canReduceWith(AbstractConverter that) |
Non-API
Guard for
AbstractConverter.reduce(AbstractConverter) |
int |
compareTo(javax.measure.UnitConverter o) |
|
protected Number |
convertWhenNotIdentity(Number value) |
Non-API
|
boolean |
equals(Object obj) |
|
double |
getBase() |
Returns the logarithmic base of this converter.
|
String |
getValue() |
|
int |
hashCode() |
|
AbstractConverter |
inverseWhenNotIdentity() |
Non-API
|
boolean |
isIdentity() |
|
boolean |
isLinear() |
|
protected AbstractConverter |
reduce(AbstractConverter that) |
Non-API
Guarded by
AbstractConverter.canReduceWith(AbstractConverter) |
String |
transformationLiteral() |
Non-API
|
concatenate, convert, convert, getConversionSteps, inverse, linearFactor, toStringpublic 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 boolean isIdentity()
protected boolean canReduceWith(AbstractConverter that)
AbstractConverterAbstractConverter.reduce(AbstractConverter)canReduceWith in class AbstractConverterthat is possible, such
that no additional conversion steps are required, with respect to the steps already
in place by this converterprotected AbstractConverter reduce(AbstractConverter that)
AbstractConverterAbstractConverter.canReduceWith(AbstractConverter)reduce in class AbstractConverterpublic AbstractConverter 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 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 AbstractConverterprotected Number convertWhenNotIdentity(Number value)
AbstractConverterconvertWhenNotIdentity in class AbstractConverterpublic boolean isLinear()
public String getValue()
getValue in interface tech.uom.lib.common.function.ValueSupplier<String>public int compareTo(javax.measure.UnitConverter o)
compareTo in interface Comparable<String>Copyright © 2005–2023 Units of Measurement project. All rights reserved.