public abstract class DefaultLocalizedNamesBase extends Object implements LocalizedNames
DefaultLocalizedNames
, used just to isolate all
hand-written code here from all generated code.Modifier and Type | Field and Description |
---|---|
protected String[] |
likelyRegionCodes |
protected Map<String,String> |
namesMap |
protected String[] |
sortedRegionCodes |
Constructor and Description |
---|
DefaultLocalizedNamesBase() |
Modifier and Type | Method and Description |
---|---|
String[] |
getLikelyRegionCodes() |
String |
getRegionName(String regionCode)
Get the localized name of a given region in this locale.
|
protected String |
getRegionNameImpl(String regionCode) |
String[] |
getSortedRegionCodes() |
protected String[] |
loadLikelyRegionCodes()
Returns a possibly-empty array of country codes, ordered by the literate
population speaking this language.
|
protected void |
loadNameMap()
Initializes {
namesMap to a map of region code (including
non-country codes) to localized names. |
protected abstract String[] |
loadSortedRegionCodes()
Returns an array of currently valid country codes ordered by the collating
order of the locale.
|
protected boolean |
needsNameMap() |
protected String[] likelyRegionCodes
protected String[] sortedRegionCodes
public final String[] getLikelyRegionCodes()
getLikelyRegionCodes
in interface LocalizedNames
public final String getRegionName(String regionCode)
LocalizedNames
getRegionName
in interface LocalizedNames
public final String[] getSortedRegionCodes()
getSortedRegionCodes
in interface LocalizedNames
protected String[] loadLikelyRegionCodes()
protected void loadNameMap()
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.protected abstract String[] loadSortedRegionCodes()
protected boolean needsNameMap()
Copyright © 2018. All rights reserved.