ucar.visad
Class Constants

java.lang.Object
  extended by ucar.visad.Constants

public class Constants
extends Object

Provides support for scientific constants.

Version:
$Revision: 1.8 $ $Date: 2005/05/13 18:34:02 $
Author:
Steven R. Emmerson

Constructor Summary
protected Constants(Constants parent)
          Constructs from a parent constant table or null.
 
Method Summary
 Real get(String name)
          Returns the constant with a given name.
static Constants instance()
          Returns an instance of this class.
 Real put(String name, Real value)
          Stores a constant into the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constants

protected Constants(Constants parent)
             throws VisADException
Constructs from a parent constant table or null. Protected to prevent use. The parent table will be searched if the constant is not found in this instances's table.

Parameters:
parent - The parent constant table or null.
Throws:
VisADException - if a core VisAD failure occurs.
Method Detail

instance

public static Constants instance()
Returns an instance of this class.

Returns:
An instance of this class.

put

public Real put(String name,
                Real value)
Stores a constant into the table.

Parameters:
name - The name of the constant.
value - The value of the constant.
Returns:
The value previously stored under the name. May be null.

get

public Real get(String name)
Returns the constant with a given name.

Parameters:
name - The name of the constant.
Returns:
The constant with the given name. May be null if not found.