com.google.gwt.i18n.client.impl.plurals
Class DefaultRule_zh

java.lang.Object
  extended by com.google.gwt.i18n.client.impl.plurals.DefaultRule
      extended by com.google.gwt.i18n.client.impl.plurals.DefaultRule_zh
All Implemented Interfaces:
Localizable, PluralRule

public class DefaultRule_zh
extends DefaultRule

Usually, there are no plural forms in Chinese. When they are used, plural forms are 1 and n, with 0 treated as plural. Plural forms are not required to be marked, but it is optional so a plural form is provided here. No warning will be issued if it is not included, as it is acceptable to use the same form. Also, note that this does not address the issue of using different symbols for the same digits depending on what is being counted.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.PluralRule
PluralRule.PluralForm
 
Constructor Summary
DefaultRule_zh()
           
 
Method Summary
 PluralRule.PluralForm[] pluralForms()
          Returns the list of values which are valid for this rule.
 int select(int n)
          Returns the plural form appropriate for this count.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRule_zh

public DefaultRule_zh()
Method Detail

pluralForms

public PluralRule.PluralForm[] pluralForms()
Description copied from interface: PluralRule
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.

Specified by:
pluralForms in interface PluralRule
Overrides:
pluralForms in class DefaultRule

select

public int select(int n)
Description copied from interface: PluralRule
Returns the plural form appropriate for this count. This method will be executed at runtime, so must be translatable.

Specified by:
select in interface PluralRule
Overrides:
select in class DefaultRule
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).