public abstract class LocaleDisplayNames
extends Object
java.lang.Object | |
↳ | android.icu.text.LocaleDisplayNames |
Returns display names of ULocales and components of ULocales. For more information on language, script, region, variant, key, and values, see ULocale
.
Nested classes |
|
---|---|
enum |
LocaleDisplayNames.DialectHandling Enum used in |
Public methods |
|
---|---|
abstract DisplayContext |
getContext(DisplayContext.Type type) Returns the current value for a specified DisplayContext.Type. |
abstract LocaleDisplayNames.DialectHandling |
getDialectHandling() Returns the dialect handling used in the display names. |
static LocaleDisplayNames |
getInstance(ULocale locale) Convenience overload of |
static LocaleDisplayNames |
getInstance(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling. |
static LocaleDisplayNames |
getInstance(Locale locale) Convenience overload of |
static LocaleDisplayNames |
getInstance(Locale locale, DisplayContext... contexts) Returns an instance of LocaleDisplayNames that returns names formatted for the provided |
static LocaleDisplayNames |
getInstance(ULocale locale, DisplayContext... contexts) Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided DisplayContext settings |
abstract ULocale |
getLocale() Returns the locale used to determine the display names. |
abstract String |
keyDisplayName(String key) Returns the display name of the provided locale key. |
abstract String |
keyValueDisplayName(String key, String value) Returns the display name of the provided value (used with the provided key). |
abstract String |
languageDisplayName(String lang) Returns the display name of the provided language code. |
abstract String |
localeDisplayName(Locale locale) Returns the display name of the provided locale. |
abstract String |
localeDisplayName(String localeId) Returns the display name of the provided locale id. |
abstract String |
localeDisplayName(ULocale locale) Returns the display name of the provided ulocale. |
abstract String |
regionDisplayName(String region) Returns the display name of the provided region code. |
abstract String |
scriptDisplayName(String script) Returns the display name of the provided script code. |
abstract String |
scriptDisplayName(int scriptCode) Returns the display name of the provided script code. |
abstract String |
variantDisplayName(String variant) Returns the display name of the provided variant. |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
DisplayContext getContext (DisplayContext.Type type)
Returns the current value for a specified DisplayContext.Type.
Parameters | |
---|---|
type |
DisplayContext.Type : the DisplayContext.Type whose value to return |
Returns | |
---|---|
DisplayContext |
the current DisplayContext setting for the specified type |
LocaleDisplayNames.DialectHandling getDialectHandling ()
Returns the dialect handling used in the display names.
Returns | |
---|---|
LocaleDisplayNames.DialectHandling |
the dialect handling enum |
LocaleDisplayNames getInstance (ULocale locale)
Convenience overload of getInstance(ULocale, DialectHandling)
that specifies STANDARD dialect handling.
Parameters | |
---|---|
locale |
ULocale : the display locale |
Returns | |
---|---|
LocaleDisplayNames |
a LocaleDisplayNames instance |
LocaleDisplayNames getInstance (ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling.
Parameters | |
---|---|
locale |
ULocale : the display locale |
dialectHandling |
LocaleDisplayNames.DialectHandling : how to select names for locales |
Returns | |
---|---|
LocaleDisplayNames |
a LocaleDisplayNames instance |
LocaleDisplayNames getInstance (Locale locale)
Convenience overload of getInstance(Locale, DisplayContext)
that specifies STANDARD_NAMES
.
Parameters | |
---|---|
locale |
Locale : the display Locale |
Returns | |
---|---|
LocaleDisplayNames |
a LocaleDisplayNames instance |
LocaleDisplayNames getInstance (Locale locale, DisplayContext... contexts)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided Locale
, using the provided DisplayContext settings
Parameters | |
---|---|
locale |
Locale : the display Locale |
contexts |
DisplayContext : one or more context settings (e.g. for dialect handling, capitalization, etc. |
Returns | |
---|---|
LocaleDisplayNames |
a LocaleDisplayNames instance |
LocaleDisplayNames getInstance (ULocale locale, DisplayContext... contexts)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided DisplayContext settings
Parameters | |
---|---|
locale |
ULocale : the display locale |
contexts |
DisplayContext : one or more context settings (e.g. for dialect handling, capitalization, etc. |
Returns | |
---|---|
LocaleDisplayNames |
a LocaleDisplayNames instance |
ULocale getLocale ()
Returns the locale used to determine the display names. This is not necessarily the same locale passed to getInstance(ULocale)
.
Returns | |
---|---|
ULocale |
the display locale |
String keyDisplayName (String key)
Returns the display name of the provided locale key.
Parameters | |
---|---|
key |
String : the locale key name |
Returns | |
---|---|
String |
the display name of the provided locale key |
String keyValueDisplayName (String key, String value)
Returns the display name of the provided value (used with the provided key).
Parameters | |
---|---|
key |
String : the locale key name |
value |
String : the locale key's value |
Returns | |
---|---|
String |
the display name of the provided value |
String languageDisplayName (String lang)
Returns the display name of the provided language code.
Parameters | |
---|---|
lang |
String : the language code |
Returns | |
---|---|
String |
the display name of the provided language code |
String localeDisplayName (Locale locale)
Returns the display name of the provided locale.
Parameters | |
---|---|
locale |
Locale : the locale whose display name to return |
Returns | |
---|---|
String |
the display name of the provided locale |
String localeDisplayName (String localeId)
Returns the display name of the provided locale id.
Parameters | |
---|---|
localeId |
String : the id of the locale whose display name to return |
Returns | |
---|---|
String |
the display name of the provided locale |
String localeDisplayName (ULocale locale)
Returns the display name of the provided ulocale.
Parameters | |
---|---|
locale |
ULocale : the locale whose display name to return |
Returns | |
---|---|
String |
the display name of the provided locale |
String regionDisplayName (String region)
Returns the display name of the provided region code.
Parameters | |
---|---|
region |
String : the region code |
Returns | |
---|---|
String |
the display name of the provided region code |
String scriptDisplayName (String script)
Returns the display name of the provided script code.
Parameters | |
---|---|
script |
String : the script code |
Returns | |
---|---|
String |
the display name of the provided script code |
String scriptDisplayName (int scriptCode)
Returns the display name of the provided script code. See UScript
for recognized script codes.
Parameters | |
---|---|
scriptCode |
int : the script code number |
Returns | |
---|---|
String |
the display name of the provided script code |
String variantDisplayName (String variant)
Returns the display name of the provided variant.
Parameters | |
---|---|
variant |
String : the variant string |
Returns | |
---|---|
String |
the display name of the provided variant |