com.isti.trinetwatch.ruleset
Class StatusLevelTag

java.lang.Object
  extended by com.isti.trinetwatch.ruleset.LevelTag
      extended by com.isti.trinetwatch.ruleset.StatusLevelTag
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class StatusLevelTag
extends LevelTag

Class StatusLevelTag defines tag objects which represent status levels.

See Also:
Serialized Form

Field Summary
static java.lang.String BAD_TAG_STR
          Name for "Bad" status level.
static java.lang.String FAIR_TAG_STR
          Name for "Fair" status level.
static java.lang.String GOOD_TAG_STR
          Name for "Good" status level.
static java.lang.String UNKNOWN_TAG_STR
          Name for "Unknown" status level.
 
Constructor Summary
StatusLevelTag(LevelTag lTagObj)
          Creates a StatusLevelTag object from an existing LevelTag object.
StatusLevelTag(java.lang.String name, int value, int colorRGB, java.lang.String description)
          Creates a StatusLevelTag object.
 
Method Summary
static StatusLevelTag decodeFormattedString(java.lang.String str)
          Decodes an ASCII formatted string into a new object.
static StatusLevelTag getUnknownStatusTag()
          Returns the status level object associated with "Unknown" status.
static void setUnknownStatusTag(StatusLevelTag tagObj)
          Sets the status level object associated with "Unknown" status.
 
Methods inherited from class com.isti.trinetwatch.ruleset.LevelTag
compareTo, compareTo, decodeFormattedLTagString, encodeFormattedString, equals, equalsIgnoreCase, equalsName, equalsName, equalsNum, getColorRGB, getDescription, getDisplayString, getName, getParsePos, getValue, hashCode, setParsePos, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BAD_TAG_STR

public static final java.lang.String BAD_TAG_STR
Name for "Bad" status level.

See Also:
Constant Field Values

FAIR_TAG_STR

public static final java.lang.String FAIR_TAG_STR
Name for "Fair" status level.

See Also:
Constant Field Values

GOOD_TAG_STR

public static final java.lang.String GOOD_TAG_STR
Name for "Good" status level.

See Also:
Constant Field Values

UNKNOWN_TAG_STR

public static final java.lang.String UNKNOWN_TAG_STR
Name for "Unknown" status level.

See Also:
Constant Field Values
Constructor Detail

StatusLevelTag

public StatusLevelTag(java.lang.String name,
                      int value,
                      int colorRGB,
                      java.lang.String description)
Creates a StatusLevelTag object.

Parameters:
name - status level tag name;
value - numeric value for level.
colorRGB - combined RGB color value for level, consisting of the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7 (same as java.awt.Color).
description - description of level.

StatusLevelTag

public StatusLevelTag(LevelTag lTagObj)
Creates a StatusLevelTag object from an existing LevelTag object.

Method Detail

decodeFormattedString

public static StatusLevelTag decodeFormattedString(java.lang.String str)
Decodes an ASCII formatted string into a new object. The format is as follows: [NNNN:VV,CCCC,"DDDD"] (without the '[]' brackets), where NNNN is the level tag name, VV is its numeric value, CCCC is a numeric RGB color value and DDDD is a description. (The DDDD item is optional.) The formatted string may be terminated by a semicolon (';') or by the end of the string. The ending parse position is saved and may be retrieved via the member function 'getParsePos()'.

Returns:
A new StatusLevelTag object, or null if a syntax error was detected in the string.

getUnknownStatusTag

public static StatusLevelTag getUnknownStatusTag()
Returns the status level object associated with "Unknown" status. This will be either a default "Unknown" status level object or an object entered by the rule-set parser via the 'setUnknownStatusTag()' method.


setUnknownStatusTag

public static void setUnknownStatusTag(StatusLevelTag tagObj)
Sets the status level object associated with "Unknown" status. This method allows the rule-set parser to enter a new "Unknown" status level object (over the default object).