Enum MeasureUnit.Complexity

  • All Implemented Interfaces:
    Serializable, Comparable<MeasureUnit.Complexity>
    Enclosing class:
    MeasureUnit

    public static enum MeasureUnit.Complexity
    extends Enum<MeasureUnit.Complexity>
    Enumeration for unit complexity. There are three levels:
    • SINGLE: A single unit, optionally with a power and/or SI or binary prefix. Examples: hectare, square-kilometer, kilojoule, per-second, mebibyte.
    • COMPOUND: A unit composed of the product of multiple single units. Examples: meter-per-second, kilowatt-hour, kilogram-meter-per-square-second.
    • MIXED: A unit composed of the sum of multiple single units. Examples: foot-and-inch, hour-and-minute-and-second, degree-and-arcminute-and-arcsecond.
    The complexity determines which operations are available. For example, you cannot set the power or prefix of a compound unit.
    Status:
    Stable ICU 68.
    • Enum Constant Detail

      • SINGLE

        public static final MeasureUnit.Complexity SINGLE
        A single unit, like kilojoule.
        Status:
        Stable ICU 68.
      • COMPOUND

        public static final MeasureUnit.Complexity COMPOUND
        A compound unit, like meter-per-second.
        Status:
        Stable ICU 68.
      • MIXED

        public static final MeasureUnit.Complexity MIXED
        A mixed unit, like hour-and-minute.
        Status:
        Stable ICU 68.
    • Method Detail

      • values

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

        public static MeasureUnit.Complexity 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