Enum Class StandardPlural
- All Implemented Interfaces:
Serializable, Comparable<StandardPlural>, Constable
Standard CLDR plural form/category constants.
See http://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of standard plural forms/categories.static final intNumeric index of OTHER, same as OTHER.ordinal().static final List<StandardPlural> Unmodifiable List of all standard plural form constants. -
Method Summary
Modifier and TypeMethodDescriptionstatic final StandardPluralfromString(CharSequence keyword) final Stringstatic final intindexFromString(CharSequence keyword) static final intindexOrNegativeFromString(CharSequence keyword) static final intindexOrOtherIndexFromString(CharSequence keyword) static final StandardPluralorNullFromString(CharSequence keyword) static final StandardPluralorOtherFromString(CharSequence keyword) static StandardPluralReturns the enum constant of this class with the specified name.static StandardPlural[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ZERO
-
ONE
-
TWO
-
FEW
-
MANY
-
OTHER
-
EQ_0
-
EQ_1
-
-
Field Details
-
OTHER_INDEX
public static final int OTHER_INDEXNumeric index of OTHER, same as OTHER.ordinal(). -
VALUES
Unmodifiable List of all standard plural form constants. List version ofvalues(). -
COUNT
public static final int COUNTNumber of standard plural forms/categories.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getKeyword
- Returns:
- the lowercase CLDR keyword string for the plural form
-
orNullFromString
- Parameters:
keyword- for example "few" or "other"- Returns:
- the plural form corresponding to the keyword, or null
-
orOtherFromString
- Parameters:
keyword- for example "few" or "other"- Returns:
- the plural form corresponding to the keyword, or OTHER
-
fromString
- 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
- Parameters:
keyword- for example "few" or "other"- Returns:
- the index of the plural form corresponding to the keyword, or a negative value
-
indexOrOtherIndexFromString
- Parameters:
keyword- for example "few" or "other"- Returns:
- the index of the plural form corresponding to the keyword, or OTHER_INDEX
-
indexFromString
- 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
-