Enum SIPrefix

  • All Implemented Interfaces:
    Named<java.lang.String>, java.io.Serializable, java.lang.Comparable<SIPrefix>

    public enum SIPrefix
    extends java.lang.Enum<SIPrefix>
    implements Named<java.lang.String>
    A prefix of the International System of Units codified by ISO 30. The prefixes appear in the order of smallest to largest factor.
    Author:
    Garret Wilson
    See Also:
    SI prefix, International System of Units
    • Method Detail

      • values

        public static SIPrefix[] 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 (SIPrefix c : SIPrefix.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SIPrefix valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Named<java.lang.String>
        Returns:
        The prefix name.
      • getSymbol

        public java.lang.String getSymbol()
        Returns:
        The prefix symbol.
      • getFactorPower

        public int getFactorPower()
        Returns:
        The power of the prefix factor with 10 as the base.
      • getFactor

        public java.math.BigDecimal getFactor()
        Returns:
        The power of the prefix.
      • toString

        public java.lang.String toString()
        Returns a string representation of the prefix. This version returns the prefix name.
        Overrides:
        toString in class java.lang.Enum<SIPrefix>
        See Also:
        getName()