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
private static class LocaleDisplayNames.LastResortLocaleDisplayNames extends 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 Modifier and Type Field Description private DisplayContext[]
contexts
private ULocale
locale
-
Constructor Summary
Constructors Modifier Constructor Description private
LastResortLocaleDisplayNames(ULocale locale, DisplayContext... contexts)
private
LastResortLocaleDisplayNames(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DisplayContext
getContext(DisplayContext.Type type)
Returns the current value for a specified DisplayContext.Type.LocaleDisplayNames.DialectHandling
getDialectHandling()
Returns the dialect handling used in the display names.ULocale
getLocale()
Returns the locale used to determine the display names.java.util.List<LocaleDisplayNames.UiListItem>
getUiListCompareWholeItems(java.util.Set<ULocale> localeSet, java.util.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.java.lang.String
keyDisplayName(java.lang.String key)
Returns the display name of the provided locale key.java.lang.String
keyValueDisplayName(java.lang.String key, java.lang.String value)
Returns the display name of the provided value (used with the provided key).java.lang.String
languageDisplayName(java.lang.String lang)
Returns the display name of the provided language code.java.lang.String
localeDisplayName(ULocale locale)
Returns the display name of the provided ulocale.java.lang.String
localeDisplayName(java.lang.String localeId)
Returns the display name of the provided locale id.java.lang.String
localeDisplayName(java.util.Locale locale)
Returns the display name of the provided locale.java.lang.String
regionDisplayName(java.lang.String region)
Returns the display name of the provided region code.java.lang.String
scriptDisplayName(int scriptCode)
Returns the display name of the provided script code.java.lang.String
scriptDisplayName(java.lang.String script)
Returns the display name of the provided script code.java.lang.String
variantDisplayName(java.lang.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 Detail
-
locale
private ULocale locale
-
contexts
private DisplayContext[] contexts
-
-
Constructor Detail
-
LastResortLocaleDisplayNames
private LastResortLocaleDisplayNames(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling)
-
LastResortLocaleDisplayNames
private LastResortLocaleDisplayNames(ULocale locale, DisplayContext... contexts)
-
-
Method Detail
-
getLocale
public ULocale 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
public LocaleDisplayNames.DialectHandling 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
public DisplayContext getContext(DisplayContext.Type type)
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
public java.lang.String localeDisplayName(ULocale locale)
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
public java.lang.String localeDisplayName(java.util.Locale locale)
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
public java.lang.String localeDisplayName(java.lang.String localeId)
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
public java.lang.String languageDisplayName(java.lang.String lang)
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
public java.lang.String scriptDisplayName(java.lang.String script)
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
public java.lang.String scriptDisplayName(int scriptCode)
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
public java.lang.String regionDisplayName(java.lang.String region)
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
public java.lang.String variantDisplayName(java.lang.String variant)
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
public java.lang.String keyDisplayName(java.lang.String key)
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
public java.lang.String keyValueDisplayName(java.lang.String key, java.lang.String value)
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 java.util.List<LocaleDisplayNames.UiListItem> getUiListCompareWholeItems(java.util.Set<ULocale> localeSet, java.util.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.
-
-