Class PluralRulesLoader
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.text.PluralRules.Factory
org.graalvm.shadowed.com.ibm.icu.impl.PluralRulesLoader
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionforLocale(ULocale locale, PluralRules.PluralType type) Returns the plural rules for the the locale.ULocale[]Returns the locales for which we have plurals data.getFunctionalEquivalent(ULocale locale, boolean[] isAvailable) Returns the functionally equivalent locale.getOrCreateRulesForLocale(ULocale locale, PluralRules.PluralType type) Gets the rule from the rulesId.Return the plurals resource.getRulesIdForLocale(ULocale locale, PluralRules.PluralType type) Gets the rulesId from the locale,with locale fallback.booleanhasOverride(ULocale locale) Returns whether or not there are overrides.Methods inherited from class org.graalvm.shadowed.com.ibm.icu.text.PluralRules.Factory
forLocale, getDefaultFactory
-
Field Details
-
loader
The only instance of the loader.
-
-
Method Details
-
getAvailableULocales
Returns the locales for which we have plurals data. Utility for testing.- Specified by:
getAvailableULocalesin classPluralRules.Factory
-
getFunctionalEquivalent
Returns the functionally equivalent locale.- Specified by:
getFunctionalEquivalentin classPluralRules.Factory- Parameters:
locale- the locale to checkisAvailable- 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
-
getRulesIdForLocale
Gets the rulesId from the locale,with locale fallback. If there is no rulesId, return null. The rulesId might be the empty string if the rule is the default rule. -
getOrCreateRulesForLocale
Gets the rule from the rulesId. If there is no rule for this rulesId, return null. -
getPluralBundle
Return the plurals resource. Note MissingResourceException is unchecked, listed here for clarity. Callers should handle this exception.- Throws:
MissingResourceException
-
forLocale
Returns the plural rules for the the locale. If we don't have data, org.graalvm.shadowed.com.ibm.icu.text.PluralRules.DEFAULT is returned.- Specified by:
forLocalein classPluralRules.Factory- Parameters:
locale- The locale for which aPluralRulesobject is returned.type- The plural type (e.g., cardinal or ordinal).- Returns:
- The predefined
PluralRulesobject 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.
-
hasOverride
Description copied from class:PluralRules.FactoryReturns whether or not there are overrides.- Specified by:
hasOverridein classPluralRules.Factory
-