Enum SIPrefixes

    • Enum Constant Detail

      • NONE

        public static final SIPrefixes NONE
        No SI prefixes allowed. E.g., for the "inch".
      • UNIT

        public static final SIPrefixes UNIT
        All standard SI prefixes allowed. E.g., for the "meter".
      • UNIT_POS

        public static final SIPrefixes UNIT_POS
        All SI prefixes indicating larger than 1. E.g., for the electronVolt to avoid underflow with float values.
      • PER_UNIT

        public static final SIPrefixes PER_UNIT
        All standard SI prefixes allowed for "per unit". E.g., for the "per second".
      • KILO

        public static final SIPrefixes KILO
        SI prefixes allowed, but default starts with "kilo" / "k", e.g., for the "kilogram".
    • Field Detail

      • UNIT_PREFIXES

        public static final Map<String,​SIPrefix> UNIT_PREFIXES
        The SI prefixes and their values for the "UNIT" settings.
      • PER_UNIT_PREFIXES

        public static final Map<String,​SIPrefix> PER_UNIT_PREFIXES
        The SI prefixes and their values for the "PER_UNIT" settings.
      • UNIT_POS_PREFIXES

        public static final Map<String,​SIPrefix> UNIT_POS_PREFIXES
        The larger than 1 SI prefixes and their values for the "UNIT_POS" settings.
      • KILO_PREFIXES

        public static final Map<String,​SIPrefix> KILO_PREFIXES
        The SI prefixes and their values for the "KILO" settings.
    • Method Detail

      • values

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

        public static SIPrefixes 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
      • getUnit

        public static SIPrefix getUnit​(String prefixKey)
        Look up and return the prefix information for the given prefix key (e.g., "G" for "giga").
        Parameters:
        prefixKey - String; the prefix key, e.g., "G" for "giga"
        Returns:
        SIPrefix; the SIPrefix information, or null if the prefixKey does not exist
      • getPerUnit

        public static SIPrefix getPerUnit​(String prefixKey)
        Look up and return the prefix information for the given prefix key (e.g., "/n" for "per nano").
        Parameters:
        prefixKey - String; the prefix key, e.g., "/n" for "per nano"
        Returns:
        SIPrefix; the SIPrefix information, or null if the prefixKey does not exist
      • getKiloUnit

        public static SIPrefix getKiloUnit​(String prefixKey)
        Return the prefix information for the given prefix key (e.g., "G" for "giga"), with an offset of a factor 1000 for units that have "kilo" as the default.
        Parameters:
        prefixKey - String; the prefix key, e.g., "G" for "giga"
        Returns:
        SIPrefix; the SIPrefix information, with an offset of 1000. So "k" will return 1, and "" will return 1.0E-3.