Enum StandardPlural

java.lang.Object
java.lang.Enum<StandardPlural>
com.ibm.icu.impl.StandardPlural
All Implemented Interfaces:
Serializable, Comparable<StandardPlural>, java.lang.constant.Constable

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

  • Field Details

    • OTHER_INDEX

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

      public static final 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 String keyword
  • Constructor Details

    • StandardPlural

      private StandardPlural(String kw)
  • Method Details

    • values

      public static StandardPlural[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

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

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

      public static final StandardPlural orNullFromString(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(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(CharSequence keyword)
      Parameters:
      keyword - for example "few" or "other"
      Returns:
      the plural form corresponding to the keyword
      Throws:
      IllegalArgumentException - if the keyword is not a plural form
    • indexOrNegativeFromString

      public static final int indexOrNegativeFromString(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(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(CharSequence keyword)
      Parameters:
      keyword - for example "few" or "other"
      Returns:
      the index of the plural form corresponding to the keyword
      Throws:
      IllegalArgumentException - if the keyword is not a plural form