Class PluralRules
java.lang.Object
com.vmware.vipclient.i18n.l2.plural.parser.PluralRules
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classA list of NumberInfo that includes all values with the same visibleFractionDigitCount.static interfacestatic enumstatic enumstatic enumSelection parameter for either integer-only or decimal-only. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PluralRulesforLocale(Locale locale, PluralRules.PluralType type) static PluralRulesgetInstance(String rule) Creates a PluralRules from a rule if it is parsable, otherwise returns null.static PluralRulesgetInstance(Map<String, String> rule) static PluralRulesParses a plural rules string and returns a PluralRules.static PluralRulesselect(double number) Given a number, returns the keyword of the first rule that applies to the number.select(PluralRules.FixedDecimal number) Deprecated.
-
Field Details
-
KEYWORD_ZERO
- See Also:
-
KEYWORD_ONE
- See Also:
-
KEYWORD_TWO
- See Also:
-
KEYWORD_FEW
- See Also:
-
KEYWORD_MANY
- See Also:
-
KEYWORD_OTHER
- See Also:
-
NO_UNIQUE_VALUE
public static final double NO_UNIQUE_VALUE- See Also:
-
KEYWORD_LIST
-
DEFAULT
The default rules
-
-
Method Details
-
parse
Parses a plural rules string and returns a PluralRules.- Parameters:
rule- the rule string.- Throws:
ParseException
-
parse
- Throws:
ParseException
-
getInstance
Creates a PluralRules from a rule if it is parsable, otherwise returns null.- Parameters:
description- the rule rule.- Returns:
- the PluralRules
-
getInstance
-
select
Given a number, returns the keyword of the first rule that applies to the number.- Parameters:
number- The number for which the rule has to be determined.- Returns:
- The keyword of the selected rule.
-
select
Deprecated.- Parameters:
number-- Returns:
-
getRules
-
forLocale
-