public interface

PluralRule

com.google.gwt.i18n.client.PluralRule
Known Indirect Subclasses

Class Overview

The interface that plural rules must implement. Implementations of this interface will be used both at compile time (pluralForms) and at run time (select), so implementations must be both translatable and not reference JSNI methods.

Summary

Nested Classes
class PluralRule.PluralForm Information about the plural forms supported by this rule which will be used during code generation and by tools to provide information to translators. 
Public Methods
abstract PluralForm[] pluralForms()
Returns the list of values which are valid for this rule.
abstract int select(int n)
Returns the plural form appropriate for this count.

Public Methods

public abstract PluralForm[] pluralForms ()

Returns the list of values which are valid for this rule. The default or "other" plural form must be first in the list with an index of 0 -- this form will be used if no other form applies and is also mapped to the default text for a given message. This method will be executed at compile time and may not contain any references, even indirectly, to JSNI methods.

public abstract int select (int n)

Returns the plural form appropriate for this count. This method will be executed at runtime, so must be translatable.

Parameters
n count of items to choose plural form for
Returns
  • the plural form to use (must be a valid index into the array returned by pluralForms).