com.isti.trinetwatch.controlAgentSim
Class StationTypeTable

java.lang.Object
  extended by com.isti.trinetwatch.controlAgentSim.StationTypeTable

public class StationTypeTable
extends java.lang.Object

This class holds a set of stations in a table


Constructor Summary
StationTypeTable()
          Creates an object of type StationType
 
Method Summary
 boolean addType(StationType typeToAdd)
          This method adds a type to the type table.
 boolean addType(java.lang.String typeName)
          This method adds a type to the type table.
 boolean contains(java.lang.String keyName)
          This method is used to see if the given type is present in the table.
 java.util.Enumeration getAllTypes()
          This method returns an enumeration of all the types held in this table.
 java.util.Enumeration getKeys()
          This method returns an enumeration of the names (keys) of all the types in the types table.
 java.lang.String getScriptPath(int level, java.lang.String typeOfStation)
          This method is used to get the path of the script associated with the given type and level.
 java.lang.Integer getTimeout(int level, java.lang.String typeOfStation)
          This method is used to get the timeout for a given level/station type pair.
 StationType getType(java.lang.String typeName)
          This method returns the type object associated with the given type name
 StationType removeType(java.lang.String typeName)
          This method removes a type from the type table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StationTypeTable

public StationTypeTable()
Creates an object of type StationType

Method Detail

addType

public boolean addType(java.lang.String typeName)
This method adds a type to the type table.

Parameters:
typeName - A string holding the name of the type to be added.
Returns:
True if the type is added correctly; false if the type already exists

addType

public boolean addType(StationType typeToAdd)
This method adds a type to the type table.

Parameters:
typeToAdd - An object of StationType which is to be added to the type table.
Returns:
True if it is added correctly; false if an object with the same name already exists in the type table or if the parameter has a null value.

removeType

public StationType removeType(java.lang.String typeName)
This method removes a type from the type table.

Parameters:
typeName - A string containing the name of the type to be removed from the type table.
Returns:
The object removed from the type table or null if no type by the given name exists.

getType

public StationType getType(java.lang.String typeName)
This method returns the type object associated with the given type name

Parameters:
typeName - A string containing the name of the type object you desire.
Returns:
An object of StationType associated with the given type name, or null if the type does not exist in the table.

getAllTypes

public java.util.Enumeration getAllTypes()
This method returns an enumeration of all the types held in this table.

Returns:
An enumeration of all the types in the table.

getKeys

public java.util.Enumeration getKeys()
This method returns an enumeration of the names (keys) of all the types in the types table.

Returns:
An enumeration of the names (keys) of all the types in the types table.

getScriptPath

public java.lang.String getScriptPath(int level,
                                      java.lang.String typeOfStation)
This method is used to get the path of the script associated with the given type and level.

Parameters:
level - The level to which will be changed
typeOfStation - The name (key) of the type of station for which the script path is desired.
Returns:
A string holding the path to the script or an empty string if something is not good.

getTimeout

public java.lang.Integer getTimeout(int level,
                                    java.lang.String typeOfStation)
This method is used to get the timeout for a given level/station type pair.

Parameters:
level - An int representing the level.
typeOfStation - The name (key) of the type of station for which the timeout is desired.
Returns:
An Integer holding the timeout or null if the station type did not exist.

contains

public boolean contains(java.lang.String keyName)
This method is used to see if the given type is present in the table.

Parameters:
keyName - A string containing the name (key) of the type to check for.
Returns:
true if the type exists in the table; false otherwise.