Example usage for com.google.gwt.i18n.client PluralRule pluralForms

List of usage examples for com.google.gwt.i18n.client PluralRule pluralForms

Introduction

In this page you can find the example usage for com.google.gwt.i18n.client PluralRule pluralForms.

Prototype

PluralForm[] pluralForms();

Source Link

Document

Returns the list of values which are valid for this rule.

Usage

From source file:com.mattbertolini.hermes.CustomPlural.java

License:Open Source License

public static Plural fromNumber(PluralRule rule, int num) {
    Plural retVal = null;/*from  w w w  .jav a 2s  . c o  m*/
    int index = rule.select(num);
    String ruleName = rule.pluralForms()[index].getName();
    if (ruleName == null || ruleName.equals(EMPTY_STRING) || ruleName.equals(OTHER)) {
        retVal = GwtPlural.OTHER;
    } else {
        retVal = new CustomPlural(ruleName);
    }
    return retVal;
}