Enum DecimalPrefix

    • Field Detail

      • PREFIX_BY_SYMBOL

        private static final java.util.Map<java.lang.String,​DecimalPrefix> PREFIX_BY_SYMBOL
      • powerOfTen

        private final int powerOfTen
      • doubleMult

        private final double doubleMult
      • symbol

        private final java.lang.String symbol
      • altSymbol

        private final java.lang.String altSymbol
      • englishName

        private final java.lang.String englishName
      • localizedName

        private transient java.lang.String localizedName
    • Constructor Detail

      • DecimalPrefix

        private DecimalPrefix​(int powerOf10,
                              char prefixChar)
      • DecimalPrefix

        private DecimalPrefix​(int powerOf10,
                              java.lang.String prefix)
      • DecimalPrefix

        private DecimalPrefix​(int powerOf10,
                              java.lang.String prefix,
                              java.lang.String altPrefix)
    • Method Detail

      • values

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

        public static DecimalPrefix 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
      • getPrefix

        public static DecimalPrefix getPrefix​(java.lang.String symbol)
      • getFloorLog10

        public static int getFloorLog10​(double value)
      • getFloorLog1000

        public static int getFloorLog1000​(double value)
      • getEngFloorPrefix

        public static DecimalPrefix getEngFloorPrefix​(double value)
      • powerOf10

        public int powerOf10()
      • doubleMult

        public double doubleMult()
      • symbol

        public final java.lang.String symbol()
        Specified by:
        symbol in interface IPrefix<DecimalPrefix>
        Returns:
        the symbol normally used to present this prefix in a GUI.
      • altSymbol

        public final java.lang.String altSymbol()
        Intended to be used for parsing GUI strings where entering the micron character may be cumbersome.
        Specified by:
        altSymbol in interface IPrefix<DecimalPrefix>
        Returns:
        alternative symbol, or null if no other representation is available
      • identifier

        public final java.lang.String identifier()
        Specified by:
        identifier in interface IPrefix<DecimalPrefix>
        Returns:
        identifier usable for constructing persistable identifiers for units.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<DecimalPrefix>