Enum UnitStyle

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UnitStyle>

    public enum UnitStyle
    extends java.lang.Enum<UnitStyle>
    Defines the different variants of unit formatting.
    Since:
    1.0.1
    Version:
    1.0
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      LABEL
      The unit will be rendered as its label.
      NAME
      The unit will be rendered as its name.
      SYMBOL
      The unit will be rendered as its symbol.
      SYMBOL_AND_LABEL
      The unit will be rendered as its symbol and also labeled.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UnitStyle()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UnitStyle valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UnitStyle[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NAME

        public static final UnitStyle NAME
        The unit will be rendered as its name.
        See Also:
        Unit.getName()
      • SYMBOL

        public static final UnitStyle SYMBOL
        The unit will be rendered as its symbol.
        See Also:
        Unit.getSymbol()
      • LABEL

        public static final UnitStyle LABEL
        The unit will be rendered as its label.
        See Also:
        javax.measure.format.UnitFormat#label()
      • SYMBOL_AND_LABEL

        public static final UnitStyle SYMBOL_AND_LABEL
        The unit will be rendered as its symbol and also labeled.
        See Also:
        Unit.getSymbol(), javax.measure.format.UnitFormat#label()
    • Constructor Detail

      • UnitStyle

        private UnitStyle()
    • Method Detail

      • values

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

        public static UnitStyle 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