com.isti.trinetwatch.controlAgentSim
Class StationType

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

public class StationType
extends java.lang.Object

This class holds a set of stations in a table


Constructor Summary
StationType(java.lang.String type)
          Creates an object of type StationType
 
Method Summary
 boolean addLevel(int levNum, int timeout, java.lang.String scriptPath)
          This method adds a new level and its corresponding timeout and script path to this type.
 java.lang.String getLevelScriptPath(int level)
          This method returns the path to the script to execute to change to this level for this given type of station.
 java.util.Enumeration getLevelsEnum()
          This method returns an enumeration of StationTypeLevelInfo objects which hold the information about each level.
 int getLevelTimeout(int level)
          Use this method to get the timeout for the given level.
 java.lang.String getTypeName()
          This method returns the name of this type.
 StationTypeLevelInfo removeLevel(int levelNumber)
          This method is used to remove a level from this type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StationType

public StationType(java.lang.String type)
Creates an object of type StationType

Parameters:
type - A string containing the name of the station type.
Method Detail

addLevel

public boolean addLevel(int levNum,
                        int timeout,
                        java.lang.String scriptPath)
This method adds a new level and its corresponding timeout and script path to this type.

Parameters:
levelNumber - An int representing the level number to be added.
timeout - An int containing the timeout for this level and type combo.
scriptPath - The path of the script to execute to change to this level.
Returns:
True if the addition went well; false if the level already exists or it could not be added for whatever reason.

getLevelScriptPath

public java.lang.String getLevelScriptPath(int level)
This method returns the path to the script to execute to change to this level for this given type of station.

Parameters:
level - The level for which you want to find out the script path.
Returns:
A string with the path in it.

getLevelsEnum

public java.util.Enumeration getLevelsEnum()
This method returns an enumeration of StationTypeLevelInfo objects which hold the information about each level.

Returns:
An enumeration of StationTypeLevelInfo objects holding info about the levels.

getLevelTimeout

public int getLevelTimeout(int level)
Use this method to get the timeout for the given level.

Parameters:
level - An int holding the level for which a timeout is desired.
Returns:
The timeout length as an int.

getTypeName

public java.lang.String getTypeName()
This method returns the name of this type.

Returns:
A string containing the name of this type.

removeLevel

public StationTypeLevelInfo removeLevel(int levelNumber)
This method is used to remove a level from this type.

Parameters:
levelNumber - An int indicating the level that is to be removed.
Returns:
An object of type StationTypeLevelInfo holding the information about this levels timeout and script path or null if there was a error removing the level.