Class ICULocaleService.LocaleKey
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.ICUService.Key
org.graalvm.shadowed.com.ibm.icu.impl.ICULocaleService.LocaleKey
- Enclosing class:
ICULocaleService
A subclass of Key that implements a locale fallback mechanism.
The first locale to search for is the locale provided by the
client, and the fallback locale to search for is the current
default locale. If a prefix is present, the currentDescriptor
includes it before the locale proper, separated by "/". This
is the default key instantiated by ICULocaleService.
Canonicalization adjusts the locale string so that the section before the first understore is in lower case, and the rest is in upper case, with no trailing underscores.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrimaryID is the user's requested locale string, canonicalPrimaryID is this string in canonical form, fallbackID is the current default locale's string in canonical form. -
Method Summary
Modifier and TypeMethodDescriptionReturn the (canonical) original ID.Convenience method to return the locale corresponding to the (canonical) original ID.static ICULocaleService.LocaleKeycreateWithCanonical(ULocale locale, String canonicalFallbackID, int kind) Create a LocaleKey with canonical primary and fallback IDs.static ICULocaleService.LocaleKeycreateWithCanonicalFallback(String primaryID, String canonicalFallbackID) Create a LocaleKey with canonical primary and fallback IDs.static ICULocaleService.LocaleKeycreateWithCanonicalFallback(String primaryID, String canonicalFallbackID, int kind) Create a LocaleKey with canonical primary and fallback IDs.Return the (canonical) current descriptor, or null if no current id.Return the (canonical) current ID, or null if no current id.Convenience method to return the ulocale corresponding to the (canonical) currentID.booleanfallback()If the key has a fallback, modify the key and return true, otherwise return false.booleanisFallbackOf(String id) If a key created from id would eventually fallback to match the canonical ID of this key, return true.intkind()Return the kind code associated with this key.prefix()Return the prefix associated with the kind, or null if the kind is KIND_ANY.Methods inherited from class ICUService.Key
id
-
Field Details
-
KIND_ANY
public static final int KIND_ANY- See Also:
-
-
Constructor Details
-
LocaleKey
-
-
Method Details
-
createWithCanonicalFallback
public static ICULocaleService.LocaleKey createWithCanonicalFallback(String primaryID, String canonicalFallbackID) Create a LocaleKey with canonical primary and fallback IDs. -
createWithCanonicalFallback
public static ICULocaleService.LocaleKey createWithCanonicalFallback(String primaryID, String canonicalFallbackID, int kind) Create a LocaleKey with canonical primary and fallback IDs. -
createWithCanonical
public static ICULocaleService.LocaleKey createWithCanonical(ULocale locale, String canonicalFallbackID, int kind) Create a LocaleKey with canonical primary and fallback IDs. -
prefix
Return the prefix associated with the kind, or null if the kind is KIND_ANY. -
kind
public int kind()Return the kind code associated with this key. -
canonicalID
Return the (canonical) original ID.- Overrides:
canonicalIDin classICUService.Key
-
currentID
Return the (canonical) current ID, or null if no current id.- Overrides:
currentIDin classICUService.Key
-
currentDescriptor
Return the (canonical) current descriptor, or null if no current id. Includes the keywords, whereas the ID does not include keywords.- Overrides:
currentDescriptorin classICUService.Key
-
canonicalLocale
Convenience method to return the locale corresponding to the (canonical) original ID. -
currentLocale
Convenience method to return the ulocale corresponding to the (canonical) currentID. -
fallback
public boolean fallback()If the key has a fallback, modify the key and return true, otherwise return false.First falls back through the primary ID, then through the fallbackID. The final fallback is "" (root) unless the primary id was "" (root), in which case there is no fallback.
- Overrides:
fallbackin classICUService.Key
-
isFallbackOf
If a key created from id would eventually fallback to match the canonical ID of this key, return true.- Overrides:
isFallbackOfin classICUService.Key
-