Enum Weight

  • All Implemented Interfaces:
    Serializable, Comparable<Weight>, Key

    public enum Weight
    extends Enum<Weight>
    implements Key
    The weight sets how thick or thin characters in text should be displayed.
    Author:
    Andrea "Stock" Stocchero
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOLD
      Defines thick characters.
      BOLDER
      Defines thicker characters.
      INHERIT
      Inherits this property from its parent element.
      INITIAL
      Sets this property to its default value.
      LIGHTER
      Defines lighter characters.
      NORMAL
      Defines normal characters.
      W100
      Defines from thin to thick characters, value 100.
      W200
      Defines from thin to thick characters, value 200.
      W300
      Defines from thin to thick characters, value 300.
      W400
      Defines from thin to thick characters, value 400.
      W500
      Defines from thin to thick characters, value 500.
      W600
      Defines from thin to thick characters, value 600.
      W700
      Defines from thin to thick characters, value 700.
      W800
      Defines from thin to thick characters, value 800.
      W900
      Defines from thin to thick characters, value 900.
    • Enum Constant Detail

      • NORMAL

        public static final Weight NORMAL
        Defines normal characters. This is default.
      • BOLD

        public static final Weight BOLD
        Defines thick characters.
      • BOLDER

        public static final Weight BOLDER
        Defines thicker characters.
      • LIGHTER

        public static final Weight LIGHTER
        Defines lighter characters.
      • INITIAL

        public static final Weight INITIAL
        Sets this property to its default value.
      • INHERIT

        public static final Weight INHERIT
        Inherits this property from its parent element.
      • W100

        public static final Weight W100
        Defines from thin to thick characters, value 100.
      • W200

        public static final Weight W200
        Defines from thin to thick characters, value 200.
      • W300

        public static final Weight W300
        Defines from thin to thick characters, value 300.
      • W400

        public static final Weight W400
        Defines from thin to thick characters, value 400.
      • W500

        public static final Weight W500
        Defines from thin to thick characters, value 500.
      • W600

        public static final Weight W600
        Defines from thin to thick characters, value 600.
      • W700

        public static final Weight W700
        Defines from thin to thick characters, value 700.
      • W800

        public static final Weight W800
        Defines from thin to thick characters, value 800.
      • W900

        public static final Weight W900
        Defines from thin to thick characters, value 900.
    • Method Detail

      • values

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

        public static Weight 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
      • value

        public String value()
        Description copied from interface: Key
        Returns the name value of property
        Specified by:
        value in interface Key
        Returns:
        the name value of property
      • getValueAsInt

        public int getValueAsInt()
        Returns the value definition from thin to thick characters.
        Returns:
        the value definition from thin to thick characters
      • isValueAsInt

        public boolean isValueAsInt()
        Returns true if the weight has been defined by a number.
        Returns:
        true if the weight has been defined by a number
      • getByIntValue

        public static Weight getByIntValue​(int value,
                                           Weight defaultValue)
        Returns the weight instance searched by the integer value.
        Parameters:
        value - integer value to use for searching
        defaultValue - default value if the value does not match
        Returns:
        the weight instance searched by the integer value