Enum StandardPlural

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

    public enum StandardPlural
    extends java.lang.Enum<StandardPlural>
    Standard CLDR plural form/category constants. See http://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules
    • Field Detail

      • OTHER_INDEX

        public static final int OTHER_INDEX
        Numeric index of OTHER, same as OTHER.ordinal().
      • VALUES

        public static final java.util.List<StandardPlural> VALUES
        Unmodifiable List of all standard plural form constants. List version of values().
      • COUNT

        public static final int COUNT
        Number of standard plural forms/categories.
      • keyword

        private final java.lang.String keyword
    • Constructor Detail

      • StandardPlural

        private StandardPlural​(java.lang.String kw)
    • Method Detail

      • values

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

        public static StandardPlural 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
      • getKeyword

        public final java.lang.String getKeyword()
        Returns:
        the lowercase CLDR keyword string for the plural form
      • orNullFromString

        public static final StandardPlural orNullFromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the plural form corresponding to the keyword, or null
      • orOtherFromString

        public static final StandardPlural orOtherFromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the plural form corresponding to the keyword, or OTHER
      • fromString

        public static final StandardPlural fromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the plural form corresponding to the keyword
        Throws:
        java.lang.IllegalArgumentException - if the keyword is not a plural form
      • indexOrNegativeFromString

        public static final int indexOrNegativeFromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the index of the plural form corresponding to the keyword, or a negative value
      • indexOrOtherIndexFromString

        public static final int indexOrOtherIndexFromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the index of the plural form corresponding to the keyword, or OTHER_INDEX
      • indexFromString

        public static final int indexFromString​(java.lang.CharSequence keyword)
        Parameters:
        keyword - for example "few" or "other"
        Returns:
        the index of the plural form corresponding to the keyword
        Throws:
        java.lang.IllegalArgumentException - if the keyword is not a plural form