com.isti.trinetwatch.ruleset
Class Criteria

java.lang.Object
  extended by com.isti.trinetwatch.ruleset.Criteria

public class Criteria
extends java.lang.Object

Class Criteria manages a list of comparison values and their translations to status levels.


Constructor Summary
Criteria()
           
 
Method Summary
 boolean add(Comparison cObj)
          Adds the given Comparison object to this object's list.
 boolean add(StatusLevelTag statusLevel, java.lang.Object value)
          Adds a Comparison object containing the given parameters to this object's list.
 java.util.Vector getComparisonSet()
          Returns the Vector of 'Comparison' objects that make up the comparison set for this criteria.
 java.lang.Class getValueClass()
          Returns the class type object for the values in the comparison list, or null if no objects exist in the list.
 java.lang.String toString()
          Returns a string representation of this object.
 StatusLevelTag valueToStatus(java.lang.Object value)
          Translates the given value to a status level using this object's list of Comparison objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Criteria

public Criteria()
Method Detail

add

public boolean add(StatusLevelTag statusLevel,
                   java.lang.Object value)
Adds a Comparison object containing the given parameters to this object's list. Note that the 'value' objects must all be of the same type and Comparable values must be in ascending order (where each 'value' is larger than the previous one).

Parameters:
statusLevel - handle of a StatusLevelTag object.
value - an object containing the value to be associated with the given status level (such as an 'Integer', 'Double', etc.)
Returns:
true if successful, false otherwise.

add

public boolean add(Comparison cObj)
Adds the given Comparison object to this object's list. Note that the 'value' objects must all be of the same type and Comparable values must be in ascending order (where each 'value' is larger than the previous one).

Parameters:
cObj - the Comparison object.
Returns:
true if successful, false otherwise.

valueToStatus

public StatusLevelTag valueToStatus(java.lang.Object value)
Translates the given value to a status level using this object's list of Comparison objects.

Parameters:
value - an object containing the value to be translated.
Returns:
The StatusLevelTag object for the given value (returns 'StatusLevelTag.unknownStatusTag' if the given value is null or if it is lower than the minimum value in the list).
Throws:
java.lang.ClassCastException - if the given object's type prevents it from being compared to the objects in the list.

getValueClass

public java.lang.Class getValueClass()
Returns the class type object for the values in the comparison list, or null if no objects exist in the list.


getComparisonSet

public java.util.Vector getComparisonSet()
Returns the Vector of 'Comparison' objects that make up the comparison set for this criteria.


toString

public java.lang.String toString()
Returns a string representation of this object. The string representation of each 'Comparison' object is put on a separate indented line.

Overrides:
toString in class java.lang.Object