Package com.ibm.icu.impl
Enum StandardPlural
- java.lang.Object
-
- java.lang.Enum<StandardPlural>
-
- com.ibm.icu.impl.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 Summary
Fields Modifier and Type Field Description static int
COUNT
Number of standard plural forms/categories.private java.lang.String
keyword
static int
OTHER_INDEX
Numeric index of OTHER, same as OTHER.ordinal().static java.util.List<StandardPlural>
VALUES
Unmodifiable List of all standard plural form constants.
-
Constructor Summary
Constructors Modifier Constructor Description private
StandardPlural(java.lang.String kw)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StandardPlural
fromString(java.lang.CharSequence keyword)
java.lang.String
getKeyword()
static int
indexFromString(java.lang.CharSequence keyword)
static int
indexOrNegativeFromString(java.lang.CharSequence keyword)
static int
indexOrOtherIndexFromString(java.lang.CharSequence keyword)
static StandardPlural
orNullFromString(java.lang.CharSequence keyword)
static StandardPlural
orOtherFromString(java.lang.CharSequence keyword)
static StandardPlural
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static StandardPlural[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ZERO
public static final StandardPlural ZERO
-
ONE
public static final StandardPlural ONE
-
TWO
public static final StandardPlural TWO
-
FEW
public static final StandardPlural FEW
-
MANY
public static final StandardPlural MANY
-
OTHER
public static final StandardPlural OTHER
-
EQ_0
public static final StandardPlural EQ_0
-
EQ_1
public static final StandardPlural EQ_1
-
-
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 ofvalues()
.
-
COUNT
public static final int COUNT
Number of standard plural forms/categories.
-
keyword
private final java.lang.String keyword
-
-
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 namejava.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
-
-