com.isti.trinetwatch.ruleset
Class StatusLevelTable

java.lang.Object
  extended by com.isti.trinetwatch.ruleset.LevelTagTable
      extended by com.isti.trinetwatch.ruleset.StatusLevelTable
All Implemented Interfaces:
java.io.Serializable

public class StatusLevelTable
extends LevelTagTable

Class StatusLevelTable manages a table of StatusLevelTag objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.isti.trinetwatch.ruleset.LevelTagTable
hTable, levelTagArray, LT_ARRAY_SIZE, maxTagValue, minTagValue
 
Constructor Summary
StatusLevelTable()
           
 
Method Summary
 boolean add(StatusLevelTag lTag)
          Adds StatusLevelTag object to table.
 boolean containsValue(StatusLevelTag lTag)
          Returns true if the specified StatusLevelTag object exists in the table.
static StatusLevelTable decodeFormattedString(java.lang.String str)
          Decodes an ASCII formatted string into a new table of StatusLevelTag objects.
 StatusLevelTag get(int num)
          Returns StatusLevelTag object associated with the given numeric value.
 StatusLevelTag get(java.lang.String str)
          Returns StatusLevelTag object associated with the given key.
 StatusLevelTag remove(int num)
          Removes StatusLevelTag object associated with the given numeric value.
 StatusLevelTag remove(java.lang.String str)
          Removes StatusLevelTag object associated with the given key.
 
Methods inherited from class com.isti.trinetwatch.ruleset.LevelTagTable
add, addLevelTag, clear, containsKey, containsValue, elements, encodeFormattedString, getMaxTagValue, getMinTagValue, getTableSyncObj, getTag, getTag, getTagColorObj, getTagSymbolChar, getValuesVector, removeTag, removeTag, removeTag, replaceTableData, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatusLevelTable

public StatusLevelTable()
Method Detail

add

public boolean add(StatusLevelTag lTag)
Adds StatusLevelTag object to table.

Returns:
true if successful, false if a object with the same name or number already exists in table or if an invalid parameter is detected.

get

public StatusLevelTag get(java.lang.String str)
Returns StatusLevelTag object associated with the given key.

Parameters:
str - a string matching the contents of the 'name' field of the desired StatusLevelTag object.
Returns:
The handle of the StatusLevelTag object or the handle of the "Unknown" StatusLevelTag object if no matching object was found.

get

public StatusLevelTag get(int num)
Returns StatusLevelTag object associated with the given numeric value.

Parameters:
num - a number matching the contents of the 'value' field of the desired StatusLevelTag object.
Returns:
The handle of the StatusLevelTag object or the handle of the "Unknown" StatusLevelTag object if no matching object was found.

remove

public StatusLevelTag remove(java.lang.String str)
Removes StatusLevelTag object associated with the given key.

Parameters:
str - a string matching the contents of the 'name' field of the StatusLevelTag object to be removed.
Returns:
The handle of the StatusLevelTag object which was removed or null if no matching object was found.

remove

public StatusLevelTag remove(int num)
Removes StatusLevelTag object associated with the given numeric value.

Parameters:
num - a number matching the contents of the 'value' field of the StatusLevelTag object to be removed.
Returns:
The handle of the StatusLevelTag object which was removed or null if no matching object was found.

containsValue

public boolean containsValue(StatusLevelTag lTag)
Returns true if the specified StatusLevelTag object exists in the table.


decodeFormattedString

public static StatusLevelTable decodeFormattedString(java.lang.String str)
Decodes an ASCII formatted string into a new table of StatusLevelTag objects. 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 StatusLevelTag items are separated by semicolons (';').

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