com.isti.trinetwatch.ruleset
Class UsageLevelTag

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

public class UsageLevelTag
extends LevelTag

Class UsageLevelTag defines tag objects which represent usage levels.

See Also:
Serialized Form

Field Summary
static java.lang.String OFF_TAG_STR
          Name for "Off" usage level.
static java.lang.String UNDEFINED_TAG_STR
          Name for "Undefined" usage level.
 
Constructor Summary
UsageLevelTag(LevelTag lTagObj)
          Creates a UsageLevelTag object from an existing LevelTag object.
UsageLevelTag(java.lang.String name, int value, int colorRGB, java.lang.String description)
          Creates a UsageLevelTag object.
 
Method Summary
static UsageLevelTag decodeFormattedString(java.lang.String str)
          Decodes an ASCII formatted string into a new object.
static UsageLevelTag getUndefinedUsageTag()
          Returns the usage level object associated with "Undefined" usage.
static void setUndefinedUsageTag(UsageLevelTag tagObj)
          Sets the usage level object associated with "Undefined" usage.
 
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

OFF_TAG_STR

public static final java.lang.String OFF_TAG_STR
Name for "Off" usage level.

See Also:
Constant Field Values

UNDEFINED_TAG_STR

public static final java.lang.String UNDEFINED_TAG_STR
Name for "Undefined" usage level.

See Also:
Constant Field Values
Constructor Detail

UsageLevelTag

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

Parameters:
name - usage 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.

UsageLevelTag

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

Method Detail

decodeFormattedString

public static UsageLevelTag 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 UsageLevelTag object, or null if a syntax error was detected in the string.

getUndefinedUsageTag

public static UsageLevelTag getUndefinedUsageTag()
Returns the usage level object associated with "Undefined" usage. This will be either a default "Undefined" usage level object or an object entered by the rule-set parser via the 'setUndefinedUsageTag()' method.


setUndefinedUsageTag

public static void setUndefinedUsageTag(UsageLevelTag tagObj)
Sets the usage level object associated with "Undefined" usage. This method allows the rule-set parser to enter a new "Undefined" usage level object (over the default object).