Class PluralRules.Factory

java.lang.Object
com.ibm.icu.text.PluralRules.Factory
Enclosing class:
PluralRules

@Deprecated public abstract static class PluralRules.Factory extends Object
Deprecated.
This API is ICU internal only.
Provides a factory for returning plural rules
  • Constructor Details

    • Factory

      @Deprecated protected Factory()
      Deprecated.
      This API is ICU internal only.
      Sole constructor
  • Method Details

    • forLocale

      @Deprecated public abstract PluralRules forLocale(ULocale locale, PluralRules.PluralType type)
      Deprecated.
      This API is ICU internal only.
      Provides access to the predefined PluralRules for a given locale and the plural type.

      ICU defines plural rules for many locales based on CLDR Language Plural Rules. For these predefined rules, see CLDR page at https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html

      Parameters:
      locale - The locale for which a PluralRules object is returned.
      type - The plural type (e.g., cardinal or ordinal).
      Returns:
      The predefined PluralRules object for this locale. If there's no predefined rules for this locale, the rules for the closest parent in the locale hierarchy that has one will be returned. The final fallback always returns the default rules.
    • forLocale

      @Deprecated public final PluralRules forLocale(ULocale locale)
      Deprecated.
      This API is ICU internal only.
      Utility for getting CARDINAL rules.
      Parameters:
      locale - the locale
      Returns:
      plural rules.
    • getAvailableULocales

      @Deprecated public abstract ULocale[] getAvailableULocales()
      Deprecated.
      This API is ICU internal only.
      Returns the locales for which there is plurals data.
    • getFunctionalEquivalent

      @Deprecated public abstract ULocale getFunctionalEquivalent(ULocale locale, boolean[] isAvailable)
      Deprecated.
      This API is ICU internal only.
      Returns the 'functionally equivalent' locale with respect to plural rules. Calling PluralRules.forLocale with the functionally equivalent locale, and with the provided locale, returns rules that behave the same.
      All locales with the same functionally equivalent locale have plural rules that behave the same. This is not exhaustive; there may be other locales whose plural rules behave the same that do not have the same equivalent locale.
      Parameters:
      locale - the locale to check
      isAvailable - if not null and of length > 0, this will hold 'true' at index 0 if locale is directly defined (without fallback) as having plural rules
      Returns:
      the functionally-equivalent locale
    • getDefaultFactory

      @Deprecated public static com.ibm.icu.impl.PluralRulesLoader getDefaultFactory()
      Deprecated.
      This API is ICU internal only.
      Returns the default factory.
    • hasOverride

      @Deprecated public abstract boolean hasOverride(ULocale locale)
      Deprecated.
      This API is ICU internal only.
      Returns whether or not there are overrides.