com.isti.trinetwatch.ruleset
Class RuleSet

java.lang.Object
  extended bycom.isti.trinetwatch.ruleset.RuleSet

public class RuleSet
extends java.lang.Object

Class RuleSet manages a table of CriteriaTable objects which map to dynamic parameters. Each station will have one RuleSet object.


Constructor Summary
RuleSet(java.lang.String name)
          Creates a rule set object.
 
Method Summary
 boolean add(java.lang.String paramName, CriteriaTable cTable)
          Adds a dynamic-parameter-name / CriteriaTable pair to the rule-set table.
 boolean add(java.lang.String paramName, UsageLevelTag usageLevel, Criteria criteriaObj)
          Adds a usage-level / criteria pair to the CriteriaTable for the given dynamic-parameter-name.
 CriteriaTable get(java.lang.String paramName)
          Returns the CriteriaTable object associated with the given dynamic parameter name.
 java.lang.String getName()
          Returns the name associated with this rule set.
 StatusLevelTag toStatus(java.lang.String paramName, UsageLevelTag usageLevel, java.lang.Number value)
          Translates the given dynamic parameter name, usage-level and numeric value to a status level.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleSet

public RuleSet(java.lang.String name)
Creates a rule set object.

Parameters:
name - the name to be associated with this rule set.
Method Detail

add

public boolean add(java.lang.String paramName,
                   CriteriaTable cTable)
Adds a dynamic-parameter-name / CriteriaTable pair to the rule-set table.

Parameters:
paramName - the name of a dynamic parameter.
cTable - the CriteriaTable object to be associated with the dynamic parameter.
Returns:
true if successful, false if an entry with the same name already exists in this table.

add

public boolean add(java.lang.String paramName,
                   UsageLevelTag usageLevel,
                   Criteria criteriaObj)
Adds a usage-level / criteria pair to the CriteriaTable for the given dynamic-parameter-name. If a CriteriaTable for the given dynamic-parameter-name does not yet exist then one is created.

Parameters:
paramName - the name of a dynamic parameter.
usageLevel - a usage-level to be entered.
criteriaObj - a Criteria object to be entered.
Returns:
true if successful, false if an object with the same usage-level already exists in the CriteriaTable.

get

public CriteriaTable get(java.lang.String paramName)
Returns the CriteriaTable object associated with the given dynamic parameter name.

Returns:
The handle of the CriteriaTable object or null if no matching object was found.

toStatus

public StatusLevelTag toStatus(java.lang.String paramName,
                               UsageLevelTag usageLevel,
                               java.lang.Number value)
Translates the given dynamic parameter name, usage-level and numeric value to a status level.

Parameters:
paramName - the name of a dynamic parameter.
usageLevel - the handle of UsageLevelTag object.
value - an object containing the numeric value to be translated (such as an 'Integer', 'Double', etc.)
Throws:
java.lang.ClassCastException - if the given object's type prevents it from being compared to the numeric objects in the list.

getName

public java.lang.String getName()
Returns the name associated with this rule set.


toString

public java.lang.String toString()
Returns a string representation of this object. The string representation of each 'CriteriaTable' object is put in a separate section delimited by a blank line.