com.isti.trinetwatch.ruleset
Class Comparison

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

public class Comparison
extends java.lang.Object

Class Comparison defines a the minimum numeric value for a status level.


Constructor Summary
Comparison(StatusLevelTag statusLevel, java.lang.Number minValue)
          Creates a Comparison object.
 
Method Summary
 boolean checkMinValue(java.lang.Number val)
          Checks if the given object 'val' is greater than or equal to the 'minValue'.
 int compareTo(java.lang.Number obj)
          Compares this object with the specified object 'obj'.
 java.lang.Number getMinValue()
          Returns the handle of the object containing the "minimum" numeric value stored in this object.
 StatusLevelTag getStatusLevel()
          Returns the handle of the StatusLevelTag for this object.
 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

Comparison

public Comparison(StatusLevelTag statusLevel,
                  java.lang.Number minValue)
Creates a Comparison object.

Parameters:
statusLevel - handle of a StatusLevelTag object.
minValue - an object containing the minimum numeric value to be associated with the given status level (such as an 'Integer', 'Double', etc.)
Method Detail

checkMinValue

public boolean checkMinValue(java.lang.Number val)
Checks if the given object 'val' is greater than or equal to the 'minValue'. The numerical representation of the given object 'val' (as defined by its 'compareTo()' function) is compared to the "minimum" value ('minValue') defined in this object.

Parameters:
val - an object which implements the 'Comparable' interface, such as 'Integer', 'Double', etc.
Returns:
true if the given object 'val' is greater than or equal to the 'minValue', false if not.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this object.

compareTo

public int compareTo(java.lang.Number obj)
Compares this object with the specified object 'obj'. The 'minValue' field of this object is compared to the numeric representation of the specified object 'obj', as defined by its 'compareTo()' function.

Parameters:
obj - an object to compare to.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this object.

getStatusLevel

public StatusLevelTag getStatusLevel()
Returns the handle of the StatusLevelTag for this object.


getMinValue

public java.lang.Number getMinValue()
Returns the handle of the object containing the "minimum" numeric value stored in this object.


toString

public java.lang.String toString()
Returns a string representation of this object.