Class LocaleDisplayNamesImpl

    • Field Detail

      • locale

        private final ULocale locale
      • separatorFormat

        private final java.lang.String separatorFormat
      • format

        private final java.lang.String format
      • keyTypeFormat

        private final java.lang.String keyTypeFormat
      • formatOpenParen

        private final char formatOpenParen
      • formatReplaceOpenParen

        private final char formatReplaceOpenParen
      • formatCloseParen

        private final char formatCloseParen
      • formatReplaceCloseParen

        private final char formatReplaceCloseParen
      • capitalizationUsage

        private boolean[] capitalizationUsage
        Capitalization transforms. For each usage type, indicates whether to titlecase for the context specified in capitalization (which we know at construction time).
      • capitalizationBrkIter

        private transient BreakIterator capitalizationBrkIter
        BreakIterator to use for capitalization
      • TO_TITLE_WHOLE_STRING_NO_LOWERCASE

        private static final CaseMap.Title TO_TITLE_WHOLE_STRING_NO_LOWERCASE
    • Method Detail

      • toTitleWholeStringNoLowercase

        private static java.lang.String toTitleWholeStringNoLowercase​(ULocale locale,
                                                                      java.lang.String s)
      • 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 class LocaleDisplayNames
        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 class LocaleDisplayNames
        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 class LocaleDisplayNames
        Parameters:
        localeId - the id of the locale whose display name to return
        Returns:
        the display name of the provided locale
      • localeDisplayNameInternal

        private java.lang.String localeDisplayNameInternal​(ULocale locale)
      • localeIdName

        private java.lang.String localeIdName​(java.lang.String localeId)
      • 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 class LocaleDisplayNames
        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 class LocaleDisplayNames
        Parameters:
        script - the script code
        Returns:
        the display name of the provided script code
      • scriptDisplayNameInContext

        private java.lang.String scriptDisplayNameInContext​(java.lang.String script,
                                                            boolean skipAdjust)
      • scriptDisplayNameInContext

        public java.lang.String scriptDisplayNameInContext​(java.lang.String script)
        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 class LocaleDisplayNames
        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. See UScript for recognized script codes.
        Specified by:
        scriptDisplayName in class LocaleDisplayNames
        Parameters:
        scriptCode - the script code number
        Returns:
        the display name of the provided script code
      • regionDisplayName

        private java.lang.String regionDisplayName​(java.lang.String region,
                                                   boolean skipAdjust)
      • 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 class LocaleDisplayNames
        Parameters:
        region - the region code
        Returns:
        the display name of the provided region code
      • variantDisplayName

        private java.lang.String variantDisplayName​(java.lang.String variant,
                                                    boolean skipAdjust)
      • 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 class LocaleDisplayNames
        Parameters:
        variant - the variant string
        Returns:
        the display name of the provided variant
      • keyDisplayName

        private java.lang.String keyDisplayName​(java.lang.String key,
                                                boolean skipAdjust)
      • 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 class LocaleDisplayNames
        Parameters:
        key - the locale key name
        Returns:
        the display name of the provided locale key
      • keyValueDisplayName

        private java.lang.String keyValueDisplayName​(java.lang.String key,
                                                     java.lang.String value,
                                                     boolean skipAdjust)
      • 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 class LocaleDisplayNames
        Parameters:
        key - the locale key name
        value - 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 class LocaleDisplayNames
        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.
      • appendWithSep

        private java.lang.StringBuilder appendWithSep​(java.lang.String s,
                                                      java.lang.StringBuilder b)