Package com.ibm.icu.impl
Class LocaleDisplayNamesImpl
java.lang.Object
com.ibm.icu.text.LocaleDisplayNames
com.ibm.icu.impl.LocaleDisplayNamesImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private final class
private static enum
Capitalization context usage types for locale display namesstatic class
(package private) static class
static enum
(package private) static class
(package private) static class
(package private) static class
(package private) static class
Nested classes/interfaces inherited from class com.ibm.icu.text.LocaleDisplayNames
LocaleDisplayNames.DialectHandling, LocaleDisplayNames.UiListItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LocaleDisplayNamesImpl.Cache
private final DisplayContext
private BreakIterator
BreakIterator to use for capitalizationprivate boolean[]
Capitalization transforms.private static final Map<String,
LocaleDisplayNamesImpl.CapitalizationContextUsage> Map from resource key to CapitalizationContextUsage valueprivate final CurrencyData.CurrencyDisplayInfo
private final LocaleDisplayNames.DialectHandling
private final String
private final char
private final char
private final char
private final char
private final String
private final LocaleDisplayNamesImpl.DataTable
private final ULocale
private final DisplayContext
private final LocaleDisplayNamesImpl.DataTable
private final String
private final DisplayContext
private static final CaseMap.Title
-
Constructor Summary
ConstructorsConstructorDescriptionLocaleDisplayNamesImpl
(ULocale locale, DisplayContext... contexts) LocaleDisplayNamesImpl
(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) -
Method Summary
Modifier and TypeMethodDescriptionprivate String
private StringBuilder
appendWithSep
(String s, StringBuilder b) Returns the current value for a specified DisplayContext.Type.Returns the dialect handling used in the display names.static LocaleDisplayNames
getInstance
(ULocale locale, DisplayContext... contexts) static LocaleDisplayNames
getInstance
(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) 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.static boolean
keyDisplayName
(String key) Returns the display name of the provided locale key.private String
keyDisplayName
(String key, boolean skipAdjust) keyValueDisplayName
(String key, String value) Returns the display name of the provided value (used with the provided key).private String
keyValueDisplayName
(String key, String value, boolean skipAdjust) 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.private String
localeDisplayNameInternal
(ULocale locale) private String
localeIdName
(String localeId) private LocaleDisplayNames.UiListItem
newRow
(ULocale modified, DisplayContext capContext) regionDisplayName
(String region) Returns the display name of the provided region code.private String
regionDisplayName
(String region, boolean skipAdjust) scriptDisplayName
(int scriptCode) Returns the display name of the provided script code.scriptDisplayName
(String script) Returns the display name of the provided script code.scriptDisplayNameInContext
(String script) Returns the display name of the provided script code when used in the context of a full locale name.private String
scriptDisplayNameInContext
(String script, boolean skipAdjust) private static String
toTitleWholeStringNoLowercase
(ULocale locale, String s) variantDisplayName
(String variant) Returns the display name of the provided variant.private String
variantDisplayName
(String variant, boolean skipAdjust) Methods inherited from class com.ibm.icu.text.LocaleDisplayNames
getInstance, getInstance, getInstance, getUiList
-
Field Details
-
locale
-
dialectHandling
-
capitalization
-
nameLength
-
substituteHandling
-
langData
-
regionData
-
separatorFormat
-
format
-
keyTypeFormat
-
formatOpenParen
private final char formatOpenParen -
formatReplaceOpenParen
private final char formatReplaceOpenParen -
formatCloseParen
private final char formatCloseParen -
formatReplaceCloseParen
private final char formatReplaceCloseParen -
currencyDisplayInfo
-
cache
-
capitalizationUsage
private boolean[] capitalizationUsageCapitalization transforms. For each usage type, indicates whether to titlecase for the context specified in capitalization (which we know at construction time). -
contextUsageTypeMap
private static final Map<String,LocaleDisplayNamesImpl.CapitalizationContextUsage> contextUsageTypeMapMap from resource key to CapitalizationContextUsage value -
capitalizationBrkIter
BreakIterator to use for capitalization -
TO_TITLE_WHOLE_STRING_NO_LOWERCASE
-
-
Constructor Details
-
LocaleDisplayNamesImpl
-
LocaleDisplayNamesImpl
-
-
Method Details
-
toTitleWholeStringNoLowercase
-
getInstance
public static LocaleDisplayNames getInstance(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling) -
getInstance
-
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
-
adjustForUsageAndContext
private String adjustForUsageAndContext(LocaleDisplayNamesImpl.CapitalizationContextUsage usage, String name) -
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
-
localeDisplayNameInternal
-
localeIdName
-
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
-
scriptDisplayNameInContext
-
scriptDisplayNameInContext
Description copied from class:LocaleDisplayNames
Returns the display name of the provided script code when used in the context of a full locale name.- Overrides:
scriptDisplayNameInContext
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
-
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
-
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
-
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
-
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.
-
newRow
-
haveData
-
appendWithSep
-