Class LogConverter

  • All Implemented Interfaces:

    public final class LogConverterextends UnitConverter

    This class represents a logarithmic converter. Such converter is typically used to create logarithmic unit. For example:

         Unit<Dimensionless> BEL = Unit.ONE.transform(new LogConverter(10).inverse());     

    Instances of this class are immutable.

    See Also:
    Serialized Form
    • Constructor Detail

      • LogConverter

        public LogConverter(double base)
        Creates a logarithmic converter having the specified base.
        base - the logarithmic base (e.g. Math.E for the Natural Logarithm).
    • Method Detail

      • getBase

        public double getBase()
        Returns the logarithmic base of this converter.
        the logarithmic base (e.g. Math.E for the Natural Logarithm).
      • inverse

        public UnitConverter inverse()
        Description copied from class: UnitConverter
        Returns the inverse of this converter. If x is a valid value, then x == inverse().convert(convert(x)) to within the accuracy of computer arithmetic.
        Specified by:
        inverse in class UnitConverter
        the inverse of this converter.
      • convert

        public double convert(double amount)
        Description copied from class: UnitConverter
        Converts a double value.
        Specified by:
        convert in class UnitConverter
        amount - the numeric value to convert.
        the converted numeric value.
      • isLinear

        public boolean isLinear()
        Description copied from class: UnitConverter
        Indicates if this converter is linear. A converter is linear if convert(u + v) == convert(u) + convert(v) and convert(r * u) == r * convert(u). For linear converters the following property always hold:
             y1 = c1.convert(x1);     y2 = c2.convert(x2);  then y1*y2 = c1.concatenate(c2).convert(x1*x2)
        Specified by:
        isLinear in class UnitConverter
        true if this converter is linear; false otherwise.

SCaVis 1.7 © jWork.org