org.eclipse.ohf.stem.geography
Class GeographicNames

java.lang.Object
  extended by org.eclipse.ohf.stem.geography.GeographicNames

public class GeographicNames
extends java.lang.Object

This class is responsible for providing NLS'd names for geographic locations.


Field Summary
static java.lang.String ALPHA2_TO_ALPHA3_NAME
          The name of the file that maps ISO-3166 alpha2 keys to ISO-3166 alpha3 keys.
static java.lang.String EARTH_ALPHA3_ISO_KEY
          The String that is used internally like an ISO-3166 alpha3 key to represent the Earth as if it was a country.
static java.lang.String LEVEL_0_ISO_NAMES_ROOT_NAME
          The root name of the file that contains the level 0 names.
 
Constructor Summary
GeographicNames()
           
 
Method Summary
static java.lang.String getAlpha3(java.lang.String alpha2ISOKey)
           
static java.lang.Object getName(java.lang.String isoKey)
           
static java.lang.String getName(java.lang.String isoKey, int level)
           
static java.lang.Object getReverseHierarchyName(java.lang.String isoKey)
           
static java.lang.Object[] getSubISOKeys(java.lang.String isoKey, int level)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EARTH_ALPHA3_ISO_KEY

public static final java.lang.String EARTH_ALPHA3_ISO_KEY
The String that is used internally like an ISO-3166 alpha3 key to represent the Earth as if it was a country.

See Also:
Constant Field Values

ALPHA2_TO_ALPHA3_NAME

public static final java.lang.String ALPHA2_TO_ALPHA3_NAME
The name of the file that maps ISO-3166 alpha2 keys to ISO-3166 alpha3 keys.

See Also:
Constant Field Values

LEVEL_0_ISO_NAMES_ROOT_NAME

public static final java.lang.String LEVEL_0_ISO_NAMES_ROOT_NAME
The root name of the file that contains the level 0 names.

See Also:
Constant Field Values
Constructor Detail

GeographicNames

public GeographicNames()
Method Detail

getName

public static java.lang.Object getName(java.lang.String isoKey)
Parameters:
isoKey -
Returns:
the name of the geographic location that matches isoKey

getName

public static java.lang.String getName(java.lang.String isoKey,
                                       int level)
Parameters:
isoKey -
level -
Returns:
the name of the geographic location that matches isoKey

getReverseHierarchyName

public static java.lang.Object getReverseHierarchyName(java.lang.String isoKey)
Parameters:
isoKey -
Returns:
the name of the location specified by the isoKey in reverse hierarchy, e.g., "Santa Clara Country, California, USA" for the ISO Key "US-CA-06085"

getSubISOKeys

public static java.lang.Object[] getSubISOKeys(java.lang.String isoKey,
                                               int level)
Parameters:
isoKey -
level - the administrative level of the key
Returns:
an array of the ISO keys that have the passed key as a prefix.

getAlpha3

public static java.lang.String getAlpha3(java.lang.String alpha2ISOKey)
Parameters:
alpha2ISOKey -
Returns:
the alpha 3 ISO key of the alpkh2 key, or the alpha 2 key if there is an error