Top Description Inners Fields Constructors Methods
com.ibm.icu.util

public final Class ULocale

extends Object
implements Serializable, Comparable<ULocale>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, java.io.Serializable
Annotations
@SuppressWarnings:javadoc
Imports
java.io.Serializable, java.lang.reflect.InvocationTargetException, .Method, java.util.ArrayList, .Arrays, .Collection, .Collections, .HashMap, .HashSet, .Iterator, .List, .Locale, .Map, .Map.Entry, .MissingResourceException, .Objects, .Set, .TreeMap, .TreeSet, com.ibm.icu.impl.CacheBase, .ICUData, .ICUResourceBundle, .ICUResourceTableAccess, .LocaleIDParser, .LocaleIDs, .SoftCache, .Utility, com.ibm.icu.impl.locale.AsciiUtil, .BaseLocale, .Extension, .InternalLocaleBuilder, .KeyTypeData, .LSR, .LanguageTag, .LocaleExtensions, .LocaleSyntaxException, .ParseStatus, .UnicodeLocaleExtension, .XLikelySubtags, com.ibm.icu.lang.UScript, com.ibm.icu.text.LocaleDisplayNames, .LocaleDisplayNames.DialectHandling

ICU Enhancement

This class is ICU's replacement for java.util.Locale.

ICU

Methods, fields, and other functionality specific to ICU are labeled 'ICU'.

A class analogous to java.util.Locale that provides additional support for ICU protocol. In ICU 3.0 this class is enhanced to support RFC 3066 language identifiers.

Many classes and services in ICU follow a factory idiom, in which a factory method or object responds to a client request with an object. The request includes a locale (the requested locale), and the returned object is constructed using data for that locale. The system may lack data for the requested locale, in which case the locale fallback mechanism will be invoked until a populated locale is found (the valid locale). Furthermore, even when a populated locale is found (the valid locale), further fallback may be required to reach a locale containing the specific data required by the service (the actual locale).

ULocale performs 'normalization' and 'canonicalization' of locale ids. Normalization 'cleans up' ICU locale ids as follows:

Canonicalization additionally performs the following: All ULocale constructors automatically normalize the locale id. To handle POSIX ids, canonicalize can be called to convert the id to canonical form, or the canonicalInstance factory method can be called.

This class provides selectors VALID_LOCALE and ACTUAL_LOCALE intended for use in methods named getLocale(). These methods exist in several ICU classes, including com.ibm.icu.util.Calendar, com.ibm.icu.util.Currency, com.ibm.icu.text.UFormat, com.ibm.icu.text.BreakIterator, com.ibm.icu.text.Collator, com.ibm.icu.text.DateFormatSymbols, and com.ibm.icu.text.DecimalFormatSymbols and their subclasses, if any. Once an object of one of these classes has been created, getLocale() may be called on it to determine the valid and actual locale arrived at during the object's construction.

Note

The actual locale is returned correctly, but the valid locale is not, in most cases.

Authors
weiv, Alan Liu, Ram Viswanadha
ICU Status
Stable since ICU 2.8.
See Also
java.util.Locale

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static enum
public static class
ULocale.Builder

Builder is used to build instances of ULocale from values configured by the setters.

public static enum
ULocale.Category

Enum for locale categories.

private static class
public static enum
ULocale.Minimize

Deprecated This API is ICU internal only.
Options for minimizeSubtags.
public static class
ULocale.Type

Opaque selector enum for getLocale().

Field Summary

Modifier and TypeField and Description
public static ULocale.Type
private transient volatile BaseLocale
baseLocale

Cache the locale data container fields.

private static final SoftCache<Locale, ULocale, Void>
public static final ULocale
CANADA

Useful constant for country/region.

public static final ULocale
CANADA_FRENCH

Useful constant for country/region.

private static String[][]
CANONICALIZE_MAP

This table lists pairs of locale ids for canonicalization.

public static final ULocale
CHINA

Useful constant for country/region.

public static final ULocale
CHINESE

Useful constant for language.

private static Locale[]
private static ULocale[]
private static Locale
defaultLocale

Keep our own default ULocale.

private static ULocale
private static final Locale
private static final String
EMPTY_STRING

Handy constant.

public static final ULocale
ENGLISH

Useful constant for language.

private transient volatile LocaleExtensions
public static final ULocale
FRANCE

Useful constant for country/region.

public static final ULocale
FRENCH

Useful constant for language.

public static final ULocale
GERMAN

Useful constant for language.

public static final ULocale
GERMANY

Useful constant for country/region.

private static Set<String>
public static final ULocale
ITALIAN

Useful constant for language.

public static final ULocale
ITALY

Useful constant for country/region.

public static final ULocale
JAPAN

Useful constant for country/region.

public static final ULocale
JAPANESE

Useful constant for language.

public static final ULocale
KOREA

Useful constant for country/region.

public static final ULocale
KOREAN

Useful constant for language.

private static final String
LANG_DIR_STRING

Pairs of (language subtag, + or -) for finding out fast if common languages are LTR (minus) or RTL (plus).

private transient volatile Locale
locale

Cache the locale.

private static final String
private String
localeID

The raw localeID that we were passed in.

private static CacheBase<String, String, Void>
public static final ULocale
PRC

Useful constant for country/region.

public static final char
PRIVATE_USE_EXTENSION

The key for the private use locale extension ('x').

public static final ULocale
ROOT

The root ULocale.

private static final long
public static final ULocale
SIMPLIFIED_CHINESE

Useful constant for language.

public static final ULocale
TAIWAN

Useful constant for country/region.

public static final ULocale
TRADITIONAL_CHINESE

Useful constant for language.

public static final ULocale
UK

Useful constant for country/region.

private static final String
private static final String
private static final String
private static final char
public static final char
UNICODE_LOCALE_EXTENSION

The key for Unicode locale extension ('u').

public static final ULocale
US

Useful constant for country/region.

public static ULocale.Type

Constructor Summary

AccessConstructor and Description
private
ULocale(String localeID, Locale locale)

Private constructor used by static initializers.

public
ULocale(String
string representation of the locale, e.g: "en_US", "sy_Cyrl_YU", "zh__pinyin", "es_ES@currency=EUR;collation=traditional"
localeID
)

ICU

public
ULocale(String a, String b)

Convenience overload of ULocale(String, String, String) for compatibility with java.util.Locale.

public
ULocale(String
first component of the locale id
a
,
String
second component of the locale id
b
,
String
third component of the locale id
c
)

Constructs a ULocale from a localeID constructed from the three 'fields' a, b, and c.

Method Summary

Modifier and TypeMethod and Description
public static ULocale

Returns:

one of the locales from the availableLocales list, or null if none match
acceptLanguage
(String
list in HTTP "Accept-Language:" format of acceptable locales
acceptLanguageList
,
ULocale[]
list of available locales. One of these will be returned.
availableLocales
,
boolean[]
if non-null, a 1-element array containing a boolean to be set with the fallback status
fallback
)

ICU

public static ULocale

Returns:

one of the locales from the availableLocales list, or null if none match
acceptLanguage
(ULocale[]
list of acceptable locales
acceptLanguageList
,
ULocale[]
list of available locales. One of these will be returned.
availableLocales
,
boolean[]
if non-null, a 1-element array containing a boolean to be set with the fallback status
fallback
)

ICU

public static ULocale

Returns:

one of the locales from the ULocale.getAvailableLocales() list, or null if none match
acceptLanguage
(String
list in HTTP "Accept-Language:" format of acceptable locales
acceptLanguageList
,
boolean[]
if non-null, a 1-element array containing a boolean to be set with the fallback status
fallback
)

ICU

public static ULocale

Returns:

one of the locales from the ULocale.getAvailableLocales() list, or null if none match
acceptLanguage
(ULocale[]
ordered array of acceptable locales (preferred are listed first)
acceptLanguageList
,
boolean[]
if non-null, a 1-element array containing a boolean to be set with the fallback status
fallback
)

ICU

public static ULocale

Returns:

The maximized ULocale instance.
addLikelySubtags
(ULocale
The ULocale to maximize
loc
)

ICU

private static void
appendTag(String
The tag to add.
tag
,
StringBuilder
The output buffer.
buffer
)

Append a tag to a StringBuilder, adding the separator if necessary.The tag must not be a zero-length string.

private BaseLocale
base()

public static String

Returns:

the canonicalized id
canonicalize
(String
the locale id
localeID
)

ICU

public Object
clone()

Overrides java.lang.Object.clone.

This is for compatibility with Locale-- in actuality, since ULocale is immutable, there is no reason to clone it, so this API returns 'this'.
public int

Returns:

a negative integer, zero, or a positive integer as this ULocale is less than, equal to, or greater than the specified ULocale.
compareTo
(ULocale
the ULocale to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares two ULocale for ordering.
public static ULocale

Returns:

the locale created from the canonical version of the ID.
createCanonical
(String
the locale id to canonicalize
nonCanonicalID
)

ICU

public static ULocale

Returns:

the ULocale created from the canonical version of the ULocale.
createCanonical
(ULocale
the ULocale to canonicalize
locale
)

Creates a ULocale from the locale by first canonicalizing the locale according to CLDR.

private static String

Returns:

The new tag string.
createTagString
(String
The language tag to use.
lang
,
String
The script tag to use.
script
,
String
The region tag to use.
region
,
String
Any trailing data to append to the new tag.
trailing
)

Create a tag string from the supplied parameters.

public boolean

Returns:

true if this Locale is equal to the specified object.
equals
(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Returns true if the other object is another ULocale with the same full name.
private LocaleExtensions
public static ULocale

Returns:

The locale that best represents the language tag.
forLanguageTag
(String
the language tag
languageTag
)

Returns a locale for the specified IETF BCP 47 language tag string.

public static ULocale
public static ULocale[]
getAvailableLocales()

ICU Note

Unlike the Locale API, this returns an array of ULocale, not Locale.

public static Collection<ULocale>
getAvailableLocalesByType(ULocale.AvailableType type)

Returns a list of all installed locales according to the specified type.

public String

Returns:

the base name as a String.
getBaseName
()

ICU

public static String

Returns:

the base name as a String.
getBaseName
(String
the locale ID as a string
localeID
)

ICU

public String

Returns:

The locale's layout orientation for characters.
getCharacterOrientation
()

ICU

public String
getCountry()

Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.

public static String
getCountry(String
The locale identification string.
localeID
)

ICU

public static ULocale

Returns:

the default ULocale.
getDefault
()

Returns the current default ULocale.

public static ULocale

Returns:

the default ULocale for the specified category.
getDefault
(ULocale.Category
the category
category
)

Returns the current default ULocale for the specified category.

public String

Returns:

the localized country name.
getDisplayCountry
()

Returns this locale's country localized for display in the default DISPLAY locale

Warning

this is for the region part of a valid locale ID; it cannot just be the region code (like "FR").

public String

Returns:

the localized country name.
getDisplayCountry
(ULocale
the locale in which to display the name.
displayLocale
)

Returns this locale's country localized for display in the provided locale

Warning

this is for the region part of a valid locale ID; it cannot just be the region code (like "FR").

public static String

Returns:

the localized country name.
getDisplayCountry
(String
the id of the locale whose country will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

ICU

public static String

Returns:

the localized country name.
getDisplayCountry
(String
the id of the locale whose country will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

ICU

private static String
getDisplayCountryInternal(ULocale locale, ULocale displayLocale)

public static String

Returns:

the localized keyword name.
getDisplayKeyword
(String
the keyword to be displayed.
keyword
)

ICU

public static String

Returns:

the localized keyword name.
getDisplayKeyword
(String
the keyword to be displayed.
keyword
,
String
the id of the locale in which to display the keyword.
displayLocaleID
)

ICU

public static String

Returns:

the localized keyword name.
getDisplayKeyword
(String
the keyword to be displayed.
keyword
,
ULocale
the locale in which to display the keyword.
displayLocale
)

ICU

private static String
getDisplayKeywordInternal(String keyword, ULocale displayLocale)

public String

Returns:

the localized value name.
getDisplayKeywordValue
(String
the keyword whose value is to be displayed.
keyword
)

ICU

public String

Returns:

the localized value name.
getDisplayKeywordValue
(String
the keyword whose value is to be displayed.
keyword
,
ULocale
the locale in which to display the value.
displayLocale
)

ICU

public static String

Returns:

the localized value name.
getDisplayKeywordValue
(String
the id of the locale whose keyword value is to be displayed.
localeID
,
String
the keyword whose value is to be displayed.
keyword
,
String
the id of the locale in which to display the value.
displayLocaleID
)

ICU

public static String

Returns:

the localized value name.
getDisplayKeywordValue
(String
the id of the locale whose keyword value is to be displayed.
localeID
,
String
the keyword whose value is to be displayed.
keyword
,
ULocale
the id of the locale in which to display the value.
displayLocale
)

ICU

private static String
getDisplayKeywordValueInternal(ULocale locale, String keyword, ULocale displayLocale)

public String

Returns:

the localized language name.
getDisplayLanguage
()

Returns this locale's language localized for display in the default DISPLAY locale.

public String

Returns:

the localized language name.
getDisplayLanguage
(ULocale
the locale in which to display the name.
displayLocale
)

Returns this locale's language localized for display in the provided locale.

public static String

Returns:

the localized language name.
getDisplayLanguage
(String
the id of the locale whose language will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

ICU

public static String

Returns:

the localized language name.
getDisplayLanguage
(String
the id of the locale whose language will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

ICU

private static String
getDisplayLanguageInternal(ULocale locale, ULocale displayLocale, boolean useDialect)

public String

Returns:

the localized language name.
getDisplayLanguageWithDialect
()

ICU

public String

Returns:

the localized language name.
getDisplayLanguageWithDialect
(ULocale
the locale in which to display the name.
displayLocale
)

ICU

public static String

Returns:

the localized language name.
getDisplayLanguageWithDialect
(String
the id of the locale whose language will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

ICU

public static String

Returns:

the localized language name.
getDisplayLanguageWithDialect
(String
the id of the locale whose language will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

ICU

public String

Returns:

the localized locale name.
getDisplayName
()

Returns this locale name localized for display in the default DISPLAY locale.

public String

Returns:

the localized locale name.
getDisplayName
(ULocale
the locale in which to display the locale name.
displayLocale
)

Returns this locale name localized for display in the provided locale.

public static String

Returns:

the localized locale name.
getDisplayName
(String
the locale whose name is to be displayed.
localeID
,
String
the id of the locale in which to display the locale name.
displayLocaleID
)

ICU

public static String

Returns:

the localized locale name.
getDisplayName
(String
the locale whose name is to be displayed.
localeID
,
ULocale
the locale in which to display the locale name.
displayLocale
)

ICU

private static String
getDisplayNameInternal(ULocale locale, ULocale displayLocale)

public String

Returns:

the localized locale name.
getDisplayNameWithDialect
()

ICU

public String

Returns:

the localized locale name.
getDisplayNameWithDialect
(ULocale
the locale in which to display the locale name.
displayLocale
)

ICU

public static String

Returns:

the localized locale name.
getDisplayNameWithDialect
(String
the locale whose name is to be displayed.
localeID
,
String
the id of the locale in which to display the locale name.
displayLocaleID
)

ICU

public static String

Returns:

the localized locale name.
getDisplayNameWithDialect
(String
the locale whose name is to be displayed.
localeID
,
ULocale
the locale in which to display the locale name.
displayLocale
)

ICU

private static String
public String

Returns:

the localized script name.
getDisplayScript
()

Returns this locale's script localized for display in the default DISPLAY locale.

public String

Returns:

the localized script name.
getDisplayScript
(ULocale
the locale in which to display the name.
displayLocale
)

Returns this locale's script localized for display in the provided locale.

public static String

Returns:

the localized script name.
getDisplayScript
(String
the id of the locale whose script will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

ICU

public static String

Returns:

the localized script name.
getDisplayScript
(String
the id of the locale whose script will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

ICU

public String

Returns:

the localized script name.
getDisplayScriptInContext
()

Deprecated This API is ICU internal only.

ICU

public String

Returns:

the localized script name.
getDisplayScriptInContext
(ULocale
the locale in which to display the name.
displayLocale
)

Deprecated This API is ICU internal only.

ICU

public static String

Returns:

the localized script name.
getDisplayScriptInContext
(String
the id of the locale whose script will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

Deprecated This API is ICU internal only.

ICU

public static String

Returns:

the localized script name.
getDisplayScriptInContext
(String
the id of the locale whose script will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

Deprecated This API is ICU internal only.

ICU

private static String
private static String
getDisplayScriptInternal(ULocale locale, ULocale displayLocale)

public String

Returns:

the localized variant name.
getDisplayVariant
()

Returns this locale's variant localized for display in the default DISPLAY locale.

public String

Returns:

the localized variant name.
getDisplayVariant
(ULocale
the locale in which to display the name.
displayLocale
)

Returns this locale's variant localized for display in the provided locale.

public static String

Returns:

the localized variant name.
getDisplayVariant
(String
the id of the locale whose variant will be displayed
localeID
,
String
the id of the locale in which to display the name.
displayLocaleID
)

ICU

public static String

Returns:

the localized variant name.
getDisplayVariant
(String
the id of the locale whose variant will be displayed.
localeID
,
ULocale
the locale in which to display the name.
displayLocale
)

ICU

private static String
getDisplayVariantInternal(ULocale locale, ULocale displayLocale)

public String

Returns:

The extension, or null if this locale defines no extension for the specified key.
getExtension
(char
the extension key
key
)

Returns the extension (or private use) value associated with the specified key, or null if there is no extension associated with the key.

public Set<Character>

Returns:

the set of extension keys, or the empty set if this locale has no extensions
getExtensionKeys
()

Returns the set of extension keys associated with this locale, or the empty set if it has no extensions.

public static String
getFallback(String localeID)

ICU

public ULocale
private static String
getFallbackString(String fallback)

Returns the given (canonical) locale id minus the last part before the tags.

private static ULocale
public String
getISO3Country()

Returns a three-letter abbreviation for this locale's country/region.

public static String
getISO3Country(String localeID)

ICU

public String
getISO3Language()

Returns a three-letter abbreviation for this locale's language.

public static String
getISO3Language(String localeID)

ICU

public static String[]
getISOCountries()

Returns a list of all 2-letter country codes defined in ISO 3166.

public static String[]
getISOLanguages()

Returns a list of all unique language codes defined in ISO 639.

public Iterator<String>

Returns:

iterator over keywords, or null if there are no keywords.
getKeywords
()

ICU

public static Iterator<String>

Returns:

an iterator over the keywords in the specified locale, or null if there are no keywords.
getKeywords
(String localeID)

ICU

public String

Returns:

the value of the keyword, or null.
getKeywordValue
(String
name of the keyword whose value is desired. Case insensitive.
keywordName
)

ICU

public static String

Returns:

String the value of the keyword as a string
getKeywordValue
(String localeID, String
name of the keyword whose value is desired. Case insensitive.
keywordName
)

ICU

public String
getLanguage()

Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.

public static String
getLanguage(String localeID)

Returns the language code for the locale ID, which will either be the empty string or a lowercase ISO 639 code.

public String

Returns:

The locale's layout orientation for lines.
getLineOrientation
()

ICU

public String

Returns:

String the full name of the localeID
getName
()

ICU

public static String

Returns:

String the full name of the localeID
getName
(String
the localeID as a string
localeID
)

ICU

public static String

Returns:

String with region to use ("" if none found).
getRegionForSupplementalData
(ULocale
The locale (includes any keywords) from which to get the region to use for supplemental data.
locale
,
boolean
If true, will try to infer region from other locale elements if not found any other way.
inferRegion
)

Deprecated This API is ICU internal only.

ICU

public String
getScript()

Returns the script code for this locale, which might be the empty string.

public static String
getScript(String localeID)

ICU

private static int

Returns:

The size of the shortest length subtag
getShortestSubtagLength
(String localeID)

Gets the shortest length subtag's size.

public Set<String>

Returns:

The set of attributes.
getUnicodeLocaleAttributes
()

Returns the set of unicode locale attributes associated with this locale, or the empty set if it has no attributes.

public Set<String>

Returns:

The set of Unicode locale keys, or the empty set if this locale has no Unicode locale keywords.
getUnicodeLocaleKeys
()

Returns the set of Unicode locale keys defined by this locale, or the empty set if this locale has none.

public String

Returns:

The Unicode locale type associated with the key, or null if the locale does not define the key.
getUnicodeLocaleType
(String
the Unicode locale key
key
)

Returns the Unicode locale type associated with the specified Unicode locale key for this locale.

public String
getVariant()

Returns the variant code for this locale, which might be the empty string.

public static String
getVariant(String localeID)

ICU

public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashCode.
private static boolean

Returns:

true if the String is empty, or if the reference is null.
isEmptyString
(String
The string to check
string
)

A trivial utility function that checks for a null reference or checks the length of the supplied String.

private static synchronized boolean
public boolean

Returns:

true if the locale's script is written right-to-left
isRightToLeft
()

ICU

private static String
lscvToID(String lang, String script, String country, String variant)

public static ULocale

Returns:

The minimized ULocale instance.
minimizeSubtags
(ULocale
The ULocale to minimize
loc
)

ICU

public static ULocale

Returns:

The minimized ULocale instance.
minimizeSubtags
(ULocale
The ULocale to minimize
loc
,
ULocale.Minimize
Indicate which should be preferred, when either the region or the script could be suppressed, but not both.
fieldToFavor
)

Deprecated This API is ICU internal only.

ICU

private static int

Returns:

The number of chars of the localeID parameter consumed.
parseTagString
(String
The locale ID to parse.
localeID
,
String[]
An array of three String references to return the subtag strings.
tags
)

Parse the language, script, and region subtags from a tag string, and return the results.

public static synchronized void
setDefault(ULocale
the new default locale
newLocale
)

Sets the default ULocale.

public static synchronized void
setDefault(ULocale.Category
the specified category to set the default locale
category
,
ULocale
the new default locale
newLocale
)

Sets the default ULocale for the specified Category.

public ULocale

Returns:

the updated locale
setKeywordValue
(String
the keyword to add/remove, or null to remove all keywords.
keyword
,
String
the value to add/set, or null to remove this particular keyword.
value
)

ICU

public static String

Returns:

the updated locale id
setKeywordValue
(String
the locale id to modify
localeID
,
String
the keyword to add/remove, or null to remove all keywords.
keyword
,
String
the value to add/set, or null to remove this particular keyword.
value
)

Given a locale id, a keyword, and a value, return a new locale id with an updated keyword and value.

private static String
stripLeadingUnd(String localeID)

Strips out the leading "und" language code case-insensitively.

public String

Returns:

a BCP47 language tag representing the locale
toLanguageTag
()

Returns a well-formed IETF BCP 47 language tag representing this locale.

public static String

Returns:

the well-formed legacy key, or null if the specified keyword cannot be mapped to a well-formed legacy key.
toLegacyKey
(String
the input locale keyword (either BCP 47 Unicode locale extension key or legacy key).
keyword
)

ICU

public static String

Returns:

the well-formed legacy type, or null if the specified keyword value cannot be mapped to a well-formed legacy type.
toLegacyType
(String
the locale keyword (either legacy keyword such as "collation" or BCP 47 Unicode locale extension key such as "co").
keyword
,
String
the locale keyword value (either BCP 47 Unicode locale extension type such as "phonebk" or legacy keyword value such as "phonebook").
value
)

ICU

public Locale

Returns:

a java.util.Locale that either exactly represents this object or is the closest approximation.
toLocale
()

ICU

public String

Returns:

a string representation of the object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this object.
public static String

Returns:

the well-formed BCP 47 Unicode locale extension key, or null if the specified locale keyword cannot be mapped to a well-formed BCP 47 Unicode locale extension key.
toUnicodeLocaleKey
(String
the input locale keyword (either legacy key such as "collation" or BCP 47 Unicode locale extension key such as "co").
keyword
)

ICU

public static String

Returns:

the well-formed BCP47 Unicode locale extension type, or null if the locale keyword value cannot be mapped to a well-formed BCP 47 Unicode locale extension type.
toUnicodeLocaleType
(String
the locale keyword (either legacy key such as "collation" or BCP 47 Unicode locale extension key such as "co").
keyword
,
String
the locale keyword value (either legacy type such as "phonebook" or BCP 47 Unicode locale extension type such as "phonebk").
value
)

ICU

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait