PluralRules

Class of android.icu.text · PluralRules.java · Android's reference

public class PluralRules implements java.io.Serializable

A language's plural categories for a number (cardinals), as ICU selects them: the rules of Unicode CLDR, which Android 16's ICU and the JDK both carry. A rule is relations joined by "and", then "or"; a relation is an operand of the number, maybe modulo a value, that is (=) or is not (!=) one of a list of values and ranges (of integers only).

Fields

public static final String KEYWORD_ZERO = "zero" source
public static final String KEYWORD_ONE = "one" source
public static final String KEYWORD_TWO = "two" source
public static final String KEYWORD_FEW = "few" source
public static final String KEYWORD_MANY = "many" source
public static final String KEYWORD_OTHER = "other" source
public static final PluralRules DEFAULT source

Other for every number, the rules of a language with no categories

Methods

public static PluralRules forLocale(Locale locale) source

The rules of a locale's language, or of its region where CLDR gives that one rules of its own

public static PluralRules forLocale(ULocale locale) source
public String select(double number) source

The category of a number: the first whose rule it meets, else other

public Set<String> getKeywords() source
public String toString() source
public boolean equals(Object o) source
public int hashCode() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.