Jeospace API

org.jeospace.text
Class LengthUnitNames

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

public class LengthUnitNames
extends java.lang.Object

Localization resource for the names of units of length.

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

Field Summary
protected static java.util.HashMap cache
          Cache of resource bundles
 
Constructor Summary
protected LengthUnitNames(java.util.Locale locale)
          Construct a LengthUnitNames object for the locale.
 
Method Summary
static LengthUnitNames getInstance()
          Return the LengthUnitNames object for the default locale.
static LengthUnitNames getInstance(java.util.Locale locale)
          Return the LengthUnitNames object for the specified locale.
 java.lang.String getName(LengthUnit lu)
          Return the localized name cooresponding to the passed LengthUnit object.
 java.lang.String[] getNames(LengthUnit[] lu)
          Return an array of localized names cooresponding to the passed LengthUnit 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

LengthUnitNames

protected LengthUnitNames(java.util.Locale locale)
Construct a LengthUnitNames 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 LengthUnitNames getInstance()
Return the LengthUnitNames object for the default locale.

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

getInstance

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

Parameters:
locale - the desired locale.
Returns:
the LengthUnitNames 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(LengthUnit[] lu)
Return an array of localized names cooresponding to the passed LengthUnit objects.

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

getName

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

Parameters:
lu - the LengthUnit onjects.
Returns:
the localized length unit name cooresponding to the LengthUnit object parameter.
Throws:
java.util.MissingResourceException - - if the resources for the specified locale do not contain a localized name for the LengthUnit.

Jeospace API

Copyright © 2006 - jeospace.org