Class DefaultLocalizedNamesBase

java.lang.Object
com.google.gwt.i18n.client.DefaultLocalizedNamesBase
All Implemented Interfaces:
LocalizedNames
Direct Known Subclasses:
DefaultLocalizedNames

public abstract class DefaultLocalizedNamesBase extends Object implements LocalizedNames
Base class of DefaultLocalizedNames, used just to isolate all hand-written code here from all generated code.
  • Field Details

    • likelyRegionCodes

      protected String[] likelyRegionCodes
    • sortedRegionCodes

      protected String[] sortedRegionCodes
    • namesMap

      protected Map<String,String> namesMap
  • Constructor Details

    • DefaultLocalizedNamesBase

      public DefaultLocalizedNamesBase()
  • Method Details

    • getLikelyRegionCodes

      public final String[] getLikelyRegionCodes()
      Specified by:
      getLikelyRegionCodes in interface LocalizedNames
      Returns:
      a possibly empty array of region codes, ordered by the literate population speaking the language of this locale.
    • getRegionName

      public final String getRegionName(String regionCode)
      Description copied from interface: LocalizedNames
      Get the localized name of a given region in this locale.
      Specified by:
      getRegionName in interface LocalizedNames
      Returns:
      localized name
    • getSortedRegionCodes

      public final String[] getSortedRegionCodes()
      Specified by:
      getSortedRegionCodes in interface LocalizedNames
      Returns:
      an array of region codes of currently valid countries, ordered according to the collating order of this locale.
    • getRegionNameImpl

      protected String getRegionNameImpl(String regionCode)
    • loadLikelyRegionCodes

      protected String[] 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

      protected abstract String[] 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.