Jeospace API

org.jeospace.text
Class TimeUnitNames

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

public class TimeUnitNames
extends java.lang.Object

Localization resource accessor for the names of TimeUnits.

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton

Field Summary
protected static java.util.HashMap cache
           
protected  java.util.ResourceBundle resources
           
 
Constructor Summary
protected TimeUnitNames(java.util.Locale locale)
          Construct a TimeUnitNames object for the locale.
 
Method Summary
static TimeUnitNames getInstance()
          Return the TimeUnitNames object for the default locale.
static TimeUnitNames getInstance(java.util.Locale locale)
          Return the TimeUnitNames object for the specified locale.
 java.lang.String[] getNames(TimeUnit[] tu)
          Return an array of localized names cooresponding to the passed TimeUnit objects.
 java.lang.String getPrefix(TimeUnit tu)
          Return the localized name cooresponding to the passed TimeUnit object.
 
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

resources

protected java.util.ResourceBundle resources
Constructor Detail

TimeUnitNames

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

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

getInstance

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

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

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

getPrefix

public java.lang.String getPrefix(TimeUnit tu)
Return the localized name cooresponding to the passed TimeUnit object.

Parameters:
tu - the TimeUnit object.
Returns:
the String of the localized name cooresponding to the TimeUnit object parameter.
Throws:
java.util.MissingResourceException - - if the resources for the specified locale do not contain a localized name for the TimeUnit.

Jeospace API

Copyright © 2006 - jeospace.org