Package com.ibm.icu.text
Class MessageFormat.PluralSelectorProvider
- java.lang.Object
-
- com.ibm.icu.text.MessageFormat.PluralSelectorProvider
-
- All Implemented Interfaces:
PluralFormat.PluralSelector
- Enclosing class:
- MessageFormat
private static final class MessageFormat.PluralSelectorProvider extends java.lang.Object implements PluralFormat.PluralSelector
This provider helps defer instantiation of a PluralRules object until we actually need to select a keyword. For example, if the number matches an explicit-value selector like "=1" we do not need any PluralRules.
-
-
Field Summary
Fields Modifier and Type Field Description private MessageFormat
msgFormat
private PluralRules
rules
private PluralRules.PluralType
type
-
Constructor Summary
Constructors Constructor Description PluralSelectorProvider(MessageFormat mf, PluralRules.PluralType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
select(java.lang.Object ctx, double number)
Given a number, returns the appropriate PluralFormat keyword.
-
-
-
Field Detail
-
msgFormat
private MessageFormat msgFormat
-
rules
private PluralRules rules
-
type
private PluralRules.PluralType type
-
-
Constructor Detail
-
PluralSelectorProvider
public PluralSelectorProvider(MessageFormat mf, PluralRules.PluralType type)
-
-
Method Detail
-
select
public java.lang.String select(java.lang.Object ctx, double number)
Description copied from interface:PluralFormat.PluralSelector
Given a number, returns the appropriate PluralFormat keyword.- Specified by:
select
in interfacePluralFormat.PluralSelector
- Parameters:
ctx
- worker object for the selector.number
- The number to be plural-formatted.- Returns:
- The selected PluralFormat keyword.
-
-