seda.sandStorm.internal
Class ConfigData

java.lang.Object
  extended by seda.sandStorm.internal.ConfigData
All Implemented Interfaces:
ConfigDataIF

public class ConfigData
extends java.lang.Object
implements ConfigDataIF

ConfigData is used to pass configuration arguments into various components.


Field Summary
private static boolean DEBUG
           
private  ManagerIF mgr
           
private  StageIF stage
           
private  java.util.Hashtable vals
           
 
Fields inherited from interface seda.sandStorm.api.ConfigDataIF
SET
 
Constructor Summary
ConfigData(ManagerIF mgr)
          Create a ConfigData with the given manager and no argument list.
ConfigData(ManagerIF mgr, java.util.Hashtable args)
          Create a ConfigData with the given manager and argument list.
ConfigData(ManagerIF mgr, java.lang.String[] args)
          Create a ConfigData with the given manager and argument list, specified as an array of strings of the form "key=value".
 
Method Summary
 boolean contains(java.lang.String key)
          Returns true if the given key is set.
 boolean getBoolean(java.lang.String key)
          Get the boolean value corresponding to the given key.
 double getDouble(java.lang.String key)
          Get the double value corresponding to the given key.
 int getInt(java.lang.String key)
          Get the integer value corresponding to the given key.
 ManagerIF getManager()
          Return the local manager.
 StageIF getStage()
          Return the stage for this ConfigData.
 java.lang.String getString(java.lang.String key)
          Get the string value corresponding to the given key.
 java.lang.String[] getStringList(java.lang.String key)
          Get the string list value corresponding to the given key.
 void setBoolean(java.lang.String key, boolean val)
          Set the given key to the given boolean value.
 void setDouble(java.lang.String key, double val)
          Set the given key to the given double value.
 void setInt(java.lang.String key, int val)
          Set the given key to the given integer value.
(package private)  void setManager(ManagerIF mgr)
           
 void setStage(StageIF stage)
          Used to set the StageIF when initializing a ConfigDataIF.
 void setString(java.lang.String key, java.lang.String val)
          Set the given key to the given string value.
 void setStringList(java.lang.String key, java.lang.String[] valarr)
          Set the given key to the given string list value.
private  java.util.Hashtable stringArrayToHT(java.lang.String[] arr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

vals

private java.util.Hashtable vals

mgr

private ManagerIF mgr

stage

private StageIF stage
Constructor Detail

ConfigData

public ConfigData(ManagerIF mgr)
Create a ConfigData with the given manager and no argument list.


ConfigData

public ConfigData(ManagerIF mgr,
                  java.util.Hashtable args)
Create a ConfigData with the given manager and argument list.


ConfigData

public ConfigData(ManagerIF mgr,
                  java.lang.String[] args)
           throws java.io.IOException
Create a ConfigData with the given manager and argument list, specified as an array of strings of the form "key=value".

Throws:
java.io.IOException - If any of the strings to not match the pattern "key=value".
Method Detail

contains

public boolean contains(java.lang.String key)
Returns true if the given key is set.

Specified by:
contains in interface ConfigDataIF

getString

public java.lang.String getString(java.lang.String key)
Get the string value corresponding to the given key. Returns null if not set.

Specified by:
getString in interface ConfigDataIF

getInt

public int getInt(java.lang.String key)
Get the integer value corresponding to the given key. Returns -1 if not set or if the value is not an integer.

Specified by:
getInt in interface ConfigDataIF

getDouble

public double getDouble(java.lang.String key)
Get the double value corresponding to the given key. Returns -1.0 if not set or if the value is not a double.

Specified by:
getDouble in interface ConfigDataIF

getBoolean

public boolean getBoolean(java.lang.String key)
Get the boolean value corresponding to the given key. Returns false if not set.

Specified by:
getBoolean in interface ConfigDataIF

getStringList

public java.lang.String[] getStringList(java.lang.String key)
Get the string list value corresponding to the given key. Returns null if not set.

Specified by:
getStringList in interface ConfigDataIF

setString

public void setString(java.lang.String key,
                      java.lang.String val)
Set the given key to the given string value.

Specified by:
setString in interface ConfigDataIF

setInt

public void setInt(java.lang.String key,
                   int val)
Set the given key to the given integer value.

Specified by:
setInt in interface ConfigDataIF

setDouble

public void setDouble(java.lang.String key,
                      double val)
Set the given key to the given double value.

Specified by:
setDouble in interface ConfigDataIF

setBoolean

public void setBoolean(java.lang.String key,
                       boolean val)
Set the given key to the given boolean value.

Specified by:
setBoolean in interface ConfigDataIF

setStringList

public void setStringList(java.lang.String key,
                          java.lang.String[] valarr)
Set the given key to the given string list value.

Specified by:
setStringList in interface ConfigDataIF

getManager

public ManagerIF getManager()
Return the local manager.

Specified by:
getManager in interface ConfigDataIF
See Also:
ManagerIF

getStage

public StageIF getStage()
Return the stage for this ConfigData.

Specified by:
getStage in interface ConfigDataIF
See Also:
StageIF

setStage

public void setStage(StageIF stage)
Description copied from interface: ConfigDataIF
Used to set the StageIF when initializing a ConfigDataIF. This is an internal interface and not for use by applications.

Specified by:
setStage in interface ConfigDataIF

setManager

void setManager(ManagerIF mgr)

stringArrayToHT

private java.util.Hashtable stringArrayToHT(java.lang.String[] arr)
                                     throws java.io.IOException
Throws:
java.io.IOException