Jeospace API

org.jeospace.text
Class CountryNames

java.lang.Object
  extended byorg.jeospace.text.CountryNames

public class CountryNames
extends java.lang.Object

Localization resource for the names of countrys, territories and areas of special sovereignty.

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
CountryCode, Locale

Field Summary
protected static java.util.HashMap cache
          Cache of resource bundles
 
Constructor Summary
protected CountryNames(java.util.Locale locale)
          Construct a CountryNames object for the locale.
 
Method Summary
static CountryNames getInstance()
          Return the CountryNames object for the default locale.
static CountryNames getInstance(java.util.Locale locale)
          Return the CountryNames object for the specified locale.
 java.lang.String getName(CountryCode code)
          Return the localized name cooresponding to the passed CountryCode object.
 java.lang.String[] getNames(CountryCode[] code)
          Return an array of localized names cooresponding to the passed CountryCode objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static final java.util.HashMap cache
Cache of resource bundles

Constructor Detail

CountryNames

protected CountryNames(java.util.Locale locale)
Construct a CountryNames object for the locale.

Throws:
MissingResourceException - - if the resources for the specified locale cannot be found or cannot be loaded.
Method Detail

getInstance

public static CountryNames getInstance()
Return the CountryNames object for the default locale.

Returns:
the CountryNames object for the default locale.
Throws:
MissingResourceException - - if the resources for the specified locale cannot be found or cannot be loaded.

getInstance

public static CountryNames getInstance(java.util.Locale locale)
Return the CountryNames object for the specified locale.

Parameters:
locale - the desired locale.
Returns:
the CountryNames object for the cooresponding locale.
Throws:
MissingResourceException - - if the resources for the specified locale cannot be found or cannot be loaded.

getNames

public java.lang.String[] getNames(CountryCode[] code)
Return an array of localized names cooresponding to the passed CountryCode objects.

Parameters:
code - an array of CountryCode onjects.
Returns:
the String[] of the localized country names cooresponding to the CountryCode object parameters.
Throws:
java.util.MissingResourceException - - if the resources for the specified locale do not contain a localized name for a CountryCode.

getName

public java.lang.String getName(CountryCode code)
Return the localized name cooresponding to the passed CountryCode object.

Parameters:
code - the CountryCode onject.
Returns:
the localized country name cooresponding to the CountryCode object parameter.
Throws:
java.util.MissingResourceException - - if the resources for the specified locale do not contain a localized name for the CountryCode.

Jeospace API

Copyright © 2006 - jeospace.org