Enum BinaryPrefix

  • All Implemented Interfaces:
    Serializable, Comparable<BinaryPrefix>, tec.uom.lib.common.function.SymbolSupplier, tec.uom.lib.common.function.UnitConverterSupplier

    @NonNullByDefault
    public enum BinaryPrefix
    extends Enum<BinaryPrefix>
    implements tec.uom.lib.common.function.SymbolSupplier, tec.uom.lib.common.function.UnitConverterSupplier
    The binary prefixes used to derive units by specific powers of 2.
    Author:
    Gaƫl L'hopital - Initial contribution
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      EXBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 260
      javax.measure.UnitConverter getConverter()
      Returns the corresponding unit converter.
      String getSymbol()
      Returns the symbol of this prefix.
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      GIBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 230
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      KIBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 210
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      MEBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 220
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      PEBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 250
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      TEBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 240
      static BinaryPrefix valueOf​(String name)
      Returns the enum constant of this type with the specified name.
      static BinaryPrefix[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      YOBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 280
      static <Q extends javax.measure.Quantity<Q>>
      javax.measure.Unit<Q>
      ZEBI​(javax.measure.Unit<Q> unit)
      Returns the specified unit multiplied by the factor 270
    • Method Detail

      • values

        public static BinaryPrefix[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BinaryPrefix c : BinaryPrefix.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BinaryPrefix valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getSymbol

        public String getSymbol()
        Returns the symbol of this prefix.
        Specified by:
        getSymbol in interface tec.uom.lib.common.function.SymbolSupplier
        Returns:
        this prefix symbol, not null.
      • getConverter

        public javax.measure.UnitConverter getConverter()
        Returns the corresponding unit converter.
        Specified by:
        getConverter in interface tec.uom.lib.common.function.UnitConverterSupplier
        Returns:
        the unit converter.
      • YOBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> YOBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 280
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e80).
      • ZEBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> ZEBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 270
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e70).
      • EXBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> EXBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 260
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e60).
      • PEBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> PEBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 250
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e50).
      • TEBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> TEBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 240
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e40).
      • GIBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> GIBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 230
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e30).
      • MEBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> MEBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 220
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e20).
      • KIBI

        public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> KIBI​(javax.measure.Unit<Q> unit)
        Returns the specified unit multiplied by the factor 210
        Type Parameters:
        Q - The type of the quantity measured by the unit.
        Parameters:
        unit - any unit.
        Returns:
        unit.times(2e10).