Package com.ibm.icu.text
Class LocaleDisplayNames.LastResortLocaleDisplayNames
java.lang.Object
com.ibm.icu.text.LocaleDisplayNames
com.ibm.icu.text.LocaleDisplayNames.LastResortLocaleDisplayNames
- Enclosing class:
- LocaleDisplayNames
Minimum implementation of LocaleDisplayNames
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ibm.icu.text.LocaleDisplayNames
LocaleDisplayNames.DialectHandling, LocaleDisplayNames.UiListItem
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
LastResortLocaleDisplayNames
(ULocale locale, DisplayContext... contexts) private
LastResortLocaleDisplayNames
(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) -
Method Summary
Modifier and TypeMethodDescriptionReturns the current value for a specified DisplayContext.Type.Returns the dialect handling used in the display names.Returns the locale used to determine the display names.getUiListCompareWholeItems
(Set<ULocale> localeSet, Comparator<LocaleDisplayNames.UiListItem> comparator) Return a list of information used to construct a UI list of locale names, providing more access to control the sorting.keyDisplayName
(String key) Returns the display name of the provided locale key.keyValueDisplayName
(String key, String value) Returns the display name of the provided value (used with the provided key).languageDisplayName
(String lang) Returns the display name of the provided language code.localeDisplayName
(ULocale locale) Returns the display name of the provided ulocale.localeDisplayName
(String localeId) Returns the display name of the provided locale id.localeDisplayName
(Locale locale) Returns the display name of the provided locale.regionDisplayName
(String region) Returns the display name of the provided region code.scriptDisplayName
(int scriptCode) Returns the display name of the provided script code.scriptDisplayName
(String script) Returns the display name of the provided script code.variantDisplayName
(String variant) Returns the display name of the provided variant.Methods inherited from class com.ibm.icu.text.LocaleDisplayNames
getInstance, getInstance, getInstance, getInstance, getInstance, getUiList, scriptDisplayNameInContext
-
Field Details
-
locale
-
contexts
-
-
Constructor Details
-
LastResortLocaleDisplayNames
private LastResortLocaleDisplayNames(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) -
LastResortLocaleDisplayNames
-
-
Method Details
-
getLocale
Description copied from class:LocaleDisplayNames
Returns the locale used to determine the display names. This is not necessarily the same locale passed toLocaleDisplayNames.getInstance(com.ibm.icu.util.ULocale)
.- Specified by:
getLocale
in classLocaleDisplayNames
- Returns:
- the display locale
-
getDialectHandling
Description copied from class:LocaleDisplayNames
Returns the dialect handling used in the display names.- Specified by:
getDialectHandling
in classLocaleDisplayNames
- Returns:
- the dialect handling enum
-
getContext
Description copied from class:LocaleDisplayNames
Returns the current value for a specified DisplayContext.Type.- Specified by:
getContext
in classLocaleDisplayNames
- Parameters:
type
- the DisplayContext.Type whose value to return- Returns:
- the current DisplayContext setting for the specified type
-
localeDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided ulocale. 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.- Specified by:
localeDisplayName
in classLocaleDisplayNames
- Parameters:
locale
- the locale whose display name to return- Returns:
- the display name of the provided locale
-
localeDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided locale. 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.- Specified by:
localeDisplayName
in classLocaleDisplayNames
- Parameters:
locale
- the locale whose display name to return- Returns:
- the display name of the provided locale
-
localeDisplayName
Description copied from class:LocaleDisplayNames
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.- Specified by:
localeDisplayName
in classLocaleDisplayNames
- Parameters:
localeId
- the id of the locale whose display name to return- Returns:
- the display name of the provided locale
-
languageDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided language code.- Specified by:
languageDisplayName
in classLocaleDisplayNames
- Parameters:
lang
- the language code- Returns:
- the display name of the provided language code
-
scriptDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided script code.- Specified by:
scriptDisplayName
in classLocaleDisplayNames
- Parameters:
script
- the script code- Returns:
- the display name of the provided script code
-
scriptDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided script code. SeeUScript
for recognized script codes.- Specified by:
scriptDisplayName
in classLocaleDisplayNames
- Parameters:
scriptCode
- the script code number- Returns:
- the display name of the provided script code
-
regionDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided region code.- Specified by:
regionDisplayName
in classLocaleDisplayNames
- Parameters:
region
- the region code- Returns:
- the display name of the provided region code
-
variantDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided variant.- Specified by:
variantDisplayName
in classLocaleDisplayNames
- Parameters:
variant
- the variant string- Returns:
- the display name of the provided variant
-
keyDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided locale key.- Specified by:
keyDisplayName
in classLocaleDisplayNames
- Parameters:
key
- the locale key name- Returns:
- the display name of the provided locale key
-
keyValueDisplayName
Description copied from class:LocaleDisplayNames
Returns the display name of the provided value (used with the provided key).- Specified by:
keyValueDisplayName
in classLocaleDisplayNames
- Parameters:
key
- the locale key namevalue
- the locale key's value- Returns:
- the display name of the provided value
-
getUiListCompareWholeItems
public List<LocaleDisplayNames.UiListItem> getUiListCompareWholeItems(Set<ULocale> localeSet, Comparator<LocaleDisplayNames.UiListItem> comparator) Description copied from class:LocaleDisplayNames
Return a list of information used to construct a UI list of locale names, providing more access to control the sorting. Normally use getUiList instead.- Specified by:
getUiListCompareWholeItems
in classLocaleDisplayNames
- Parameters:
localeSet
- a list of locales to present in a UI list. The casing uses the settings in the LocaleDisplayNames instance.comparator
- how to sort the UiListItems in the result.- Returns:
- an ordered list of UiListItems.
-