Interface MultiplyConverter

  • All Superinterfaces:
    Comparable<javax.measure.UnitConverter>, tech.uom.lib.common.function.Converter<Number,​Number>, tech.uom.lib.common.function.FactorSupplier<Number>, javax.measure.UnitConverter, tech.uom.lib.common.function.ValueSupplier<Number>
    All Known Implementing Classes:
    PowerOfIntConverter, RationalConverter

    public interface MultiplyConverter
    extends javax.measure.UnitConverter, tech.uom.lib.common.function.Converter<Number,​Number>, tech.uom.lib.common.function.ValueSupplier<Number>, tech.uom.lib.common.function.FactorSupplier<Number>, Comparable<javax.measure.UnitConverter>

    This class represents a converter multiplying numeric values by a constant scaling factor represented by the Number type.

    Since:
    1.0
    Version:
    2.6, September 10, 2019
    Author:
    Jean-Marie Dautelle, Werner Keil, Andi Huber
    • Method Summary

      Modifier and Type Method Description
      default Number getFactor()
      Returns the scale factor of this converter.
      static MultiplyConverter identity()
      Returns a MultiplyConverter that acts as a 'pass-through'.
      default boolean isLinear()  
      static MultiplyConverter of​(double factor)
      Creates a MultiplyConverter with the specified constant factor.
      static MultiplyConverter of​(Number factor)
      Creates a MultiplyConverter with the specified constant factor.
      static MultiplyConverter ofExponent​(int base, int exponent)
      Creates a MultiplyConverter with the specified base and exponent.
      static MultiplyConverter ofPiExponent​(int exponent)
      Creates a MultiplyConverter with the specified exponent of Pi.
      static MultiplyConverter ofPrefix​(javax.measure.Prefix prefix)
      Creates a MultiplyConverter with the specified Prefix.
      static MultiplyConverter ofRational​(long dividend, long divisor)
      Creates a MultiplyConverter with the specified rational factor made up of dividend and divisor
      static MultiplyConverter ofRational​(BigInteger dividend, BigInteger divisor)
      Creates a MultiplyConverter with the specified rational factor made up of dividend and divisor
      static MultiplyConverter ofRational​(RationalNumber factor)  
      static MultiplyConverter ofTenExponent​(int exponent)
      Creates a MultiplyConverter with base 10 and an exponent.
      • Methods inherited from interface tech.uom.lib.common.function.Converter

        convert
      • Methods inherited from interface javax.measure.UnitConverter

        concatenate, convert, convert, getConversionSteps, inverse, isIdentity
      • Methods inherited from interface tech.uom.lib.common.function.ValueSupplier

        getValue
    • Method Detail

      • ofRational

        static MultiplyConverter ofRational​(long dividend,
                                            long divisor)
        Creates a MultiplyConverter with the specified rational factor made up of dividend and divisor
        Parameters:
        dividend -
        divisor -
      • of

        static MultiplyConverter of​(Number factor)
        Creates a MultiplyConverter with the specified constant factor.
        Parameters:
        factor -
        Returns:
      • of

        static MultiplyConverter of​(double factor)
        Creates a MultiplyConverter with the specified constant factor.
        Parameters:
        factor - the double factor.
        Returns:
        a new MultiplyConverter.
      • ofPrefix

        static MultiplyConverter ofPrefix​(javax.measure.Prefix prefix)
        Creates a MultiplyConverter with the specified Prefix.
        Parameters:
        prefix - the prefix for the factor.
        Returns:
        a new MultiplyConverter.
      • ofPiExponent

        static MultiplyConverter ofPiExponent​(int exponent)
        Creates a MultiplyConverter with the specified exponent of Pi.
        Parameters:
        exponent - the exponent for the factor π^exponent.
        Returns:
        a new MultiplyConverter.
      • ofExponent

        static MultiplyConverter ofExponent​(int base,
                                            int exponent)
        Creates a MultiplyConverter with the specified base and exponent.
        Parameters:
        base - the base.
        exponent - the exponent.
        Returns:
        a new MultiplyConverter.
      • ofTenExponent

        static MultiplyConverter ofTenExponent​(int exponent)
        Creates a MultiplyConverter with base 10 and an exponent.
        Parameters:
        exponent - the exponent for the factor 10^exponent.
      • isLinear

        default boolean isLinear()
        Specified by:
        isLinear in interface javax.measure.UnitConverter
      • getFactor

        default Number getFactor()
        Returns the scale factor of this converter.
        Specified by:
        getFactor in interface tech.uom.lib.common.function.FactorSupplier<Number>
        Returns:
        the scale factor.