com.isti.trinetwatch.ruleset
Class UsageLevelTable

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

public class UsageLevelTable
extends LevelTagTable

Class UsageLevelTable manages a table of UsageLevelTag 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
UsageLevelTable()
           
 
Method Summary
 boolean add(UsageLevelTag lTag)
          Adds UsageLevelTag object to table.
 boolean containsValue(UsageLevelTag lTag)
          Returns true if the specified UsageLevelTag object exists in the table.
static UsageLevelTable decodeFormattedString(java.lang.String str)
          Decodes an ASCII formatted string into a new table of UsageLevelTag objects.
 UsageLevelTag get(int num)
          Returns UsageLevelTag object associated with the given numeric value.
 UsageLevelTag get(java.lang.String str)
          Returns UsageLevelTag object associated with the given key.
 UsageLevelTag remove(int num)
          Removes UsageLevelTag object associated with the given numeric value.
 UsageLevelTag remove(java.lang.String str)
          Removes UsageLevelTag 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

UsageLevelTable

public UsageLevelTable()
Method Detail

add

public boolean add(UsageLevelTag lTag)
Adds UsageLevelTag 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 UsageLevelTag get(java.lang.String str)
Returns UsageLevelTag object associated with the given key.

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

get

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

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

remove

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

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

remove

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

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

containsValue

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


decodeFormattedString

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

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