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

public abstract Class LocaleDisplayNames

extends Object
Class Inheritance
Known Direct Subclasses
com.ibm.icu.text.LocaleDisplayNames.LastResortLocaleDisplayNames, com.ibm.icu.impl.LocaleDisplayNamesImpl
Imports
java.lang.reflect.InvocationTargetException, .Method, java.util.Collections, .Comparator, .List, .Locale, .Set, com.ibm.icu.impl.ICUConfig, com.ibm.icu.lang.UScript, com.ibm.icu.text.DisplayContext.Type, com.ibm.icu.util.IllformedLocaleException, .ULocale

Returns display names of ULocales and components of ULocales. For more information on language, script, region, variant, key, and values, see com.ibm.icu.util.ULocale.
ICU Status
Stable since ICU 4.4.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
private static class
LocaleDisplayNames.LastResortLocaleDisplayNames

Minimum implementation of LocaleDisplayNames

public static class
LocaleDisplayNames.UiListItem

Struct-like class used to return information for constructing a UI list, each corresponding to a locale.

Field Summary

Modifier and TypeField and Description
private static final Method
private static final Method

Constructor Summary

AccessConstructor and Description
protected
LocaleDisplayNames()

Deprecated This API is ICU internal only.
Sole constructor.

Method Summary

Modifier and TypeMethod and Description
public abstract DisplayContext

Returns:

the current DisplayContext setting for the specified type
getContext
(DisplayContext.Type
the DisplayContext.Type whose value to return
type
)

Returns the current value for a specified DisplayContext.Type.

public abstract LocaleDisplayNames.DialectHandling

Returns:

the dialect handling enum
getDialectHandling
()

Returns the dialect handling used in the display names.

public static LocaleDisplayNames

Returns:

a LocaleDisplayNames instance
getInstance
(ULocale
the display locale
locale
)

Convenience overload of getInstance(ULocale, DialectHandling) that specifies STANDARD dialect handling.

public static LocaleDisplayNames

Returns:

a LocaleDisplayNames instance
getInstance
(Locale
the display java.util.Locale
locale
)

Convenience overload of getInstance(Locale, DisplayContext...) that specifies DisplayContext#STANDARD_NAMES.

public static LocaleDisplayNames

Returns:

a LocaleDisplayNames instance
getInstance
(ULocale
the display locale
locale
,
LocaleDisplayNames.DialectHandling
how to select names for locales
dialectHandling
)

Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling.

public static LocaleDisplayNames

Returns:

a LocaleDisplayNames instance
getInstance
(ULocale
the display locale
locale
,
DisplayContext...
one or more context settings (e.g. for dialect handling, capitalization, etc.
contexts
)

Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided DisplayContext settings

public static LocaleDisplayNames

Returns:

a LocaleDisplayNames instance
getInstance
(Locale
the display java.util.Locale
locale
,
DisplayContext...
one or more context settings (e.g. for dialect handling, capitalization, etc.
contexts
)

Returns an instance of LocaleDisplayNames that returns names formatted for the provided java.util.Locale, using the provided DisplayContext settings

public abstract ULocale

Returns:

the display locale
getLocale
()

Returns the locale used to determine the display names.

public List<LocaleDisplayNames.UiListItem>

Returns:

an ordered list of UiListItems.
getUiList
(Set<ULocale>
a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance.
localeSet
,
boolean
if true, compares the nameInSelf, otherwise the nameInDisplayLocale. Set depending on which field (displayLocale vs self) is to show up in the UI. If both are to show up in the UI, then it should be the one used for the primary sort order.
inSelf
,
Comparator<Object>
how to collate—should normally be Collator.getInstance(getDisplayLocale())
collator
)

Return a list of information used to construct a UI list of locale names.

public abstract List<LocaleDisplayNames.UiListItem>

Returns:

an ordered list of UiListItems.
getUiListCompareWholeItems
(Set<ULocale>
a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance.
localeSet
,
Comparator<LocaleDisplayNames.UiListItem>
how to sort the UiListItems in the result.
comparator
)

Return a list of information used to construct a UI list of locale names, providing more access to control the sorting.

public abstract String

Returns:

the display name of the provided locale key
keyDisplayName
(String
the locale key name
key
)

Returns the display name of the provided locale key.

public abstract String

Returns:

the display name of the provided value
keyValueDisplayName
(String
the locale key name
key
,
String
the locale key's value
value
)

Returns the display name of the provided value (used with the provided key).

public abstract String

Returns:

the display name of the provided language code
languageDisplayName
(String
the language code
lang
)

Returns the display name of the provided language code.

public abstract String

Returns:

the display name of the provided locale
localeDisplayName
(ULocale
the locale whose display name to return
locale
)

Returns the display name of the provided ulocale.

public abstract String

Returns:

the display name of the provided locale
localeDisplayName
(Locale
the locale whose display name to return
locale
)

Returns the display name of the provided locale.

public abstract String

Returns:

the display name of the provided locale
localeDisplayName
(String
the id of the locale whose display name to return
localeId
)

Returns the display name of the provided locale id. When no display names are available for all or portions of the original locale ID, those portions may be used directly (possibly in a more canonical form) as part of the returned display name.

public abstract String

Returns:

the display name of the provided region code
regionDisplayName
(String
the region code
region
)

Returns the display name of the provided region code.

public abstract String

Returns:

the display name of the provided script code
scriptDisplayName
(String
the script code
script
)

Returns the display name of the provided script code.

public abstract String

Returns:

the display name of the provided script code
scriptDisplayName
(int
the script code number
scriptCode
)

Returns the display name of the provided script code.

public String

Returns:

the display name of the provided script code
scriptDisplayNameInContext
(String
the script code
script
)

Deprecated This API is ICU internal only.
Returns the display name of the provided script code when used in the context of a full locale name.
public abstract String

Returns:

the display name of the provided variant
variantDisplayName
(String
the variant string
variant
)

Returns the display name of the provided variant.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait