Package com.google.gwt.i18n.client
Class DefaultLocalizedNamesBase
java.lang.Object
com.google.gwt.i18n.client.DefaultLocalizedNamesBase
- All Implemented Interfaces:
LocalizedNames
- Direct Known Subclasses:
DefaultLocalizedNames
Base class of
DefaultLocalizedNames
, used just to isolate all
hand-written code here from all generated code.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String[]
final String
getRegionName
(String regionCode) Get the localized name of a given region in this locale.protected String
getRegionNameImpl
(String regionCode) final String[]
protected String[]
Returns a possibly-empty array of country codes, ordered by the literate population speaking this language.protected void
Initializes {namesMap
to a map of region code (including non-country codes) to localized names.protected abstract String[]
Returns an array of currently valid country codes ordered by the collating order of the locale.protected boolean
-
Field Details
-
likelyRegionCodes
-
sortedRegionCodes
-
namesMap
-
-
Constructor Details
-
DefaultLocalizedNamesBase
public DefaultLocalizedNamesBase()
-
-
Method Details
-
getLikelyRegionCodes
- Specified by:
getLikelyRegionCodes
in interfaceLocalizedNames
- Returns:
- a possibly empty array of region codes, ordered by the literate population speaking the language of this locale.
-
getRegionName
Description copied from interface:LocalizedNames
Get the localized name of a given region in this locale.- Specified by:
getRegionName
in interfaceLocalizedNames
- Parameters:
regionCode
-- Returns:
- localized name
-
getSortedRegionCodes
- Specified by:
getSortedRegionCodes
in interfaceLocalizedNames
- Returns:
- an array of region codes of currently valid countries, ordered according to the collating order of this locale.
-
getRegionNameImpl
-
loadLikelyRegionCodes
Returns a possibly-empty array of country codes, ordered by the literate population speaking this language. The default implementation is an empty array.- Returns:
- a possibly-empty array of likely country codes
-
loadNameMap
protected void loadNameMap()Initializes {namesMap
to a map of region code (including non-country codes) to localized names. Subclasses should generally call the parent implementation and then change specific entries, though if most entries are being changed they can just create their own map. -
loadSortedRegionCodes
Returns an array of currently valid country codes ordered by the collating order of the locale.- Returns:
- an array of ordered country codes
-
needsNameMap
protected boolean needsNameMap()- Returns:
- true if the name map needs to be loaded -- subclasses that provide alternate storage for the name map (such as in JSOs) should override this.
-