edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils
Class TreeStorage

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils.TreeStorage

public class TreeStorage
extends java.lang.Object

The TreeStorage class stores all of the trees' operators and queues. The HashMap's 'key' is the XATTree and the 'value' is a HashMap. This second HashMap's 'key' is a String ('OPERATORS' or 'QUEUES') and 'value' is an ArrayList of either operators or queues. The list of operators and queues is unordered.

Author:
Maylene Waltz

Constructor Summary
TreeStorage()
          Initializes the TreeStorage HashMap.
 
Method Summary
 java.util.Iterator getAllOperators()
          Returns an Iterator of all the operators.
 java.util.Iterator getAllQueues()
          Returns an Iterator of all the queues.
 java.util.Iterator getAllTrees()
          Returns an Iterator of all the trees.
 java.util.Set getKeys()
          Returns a Set of keys (or XATTrees) of this HashMap.
 java.lang.Object getOperator(java.lang.String objectID)
          Returns the XATStreamOperator with the given objectID.
 java.lang.Object getOperators(XATTree tree)
          Returns an ArrayList of XATQueryObjects (operators) that belong to the given tree.
 java.lang.Object getQueue(java.lang.String objectID)
          Returns the XATQueue with the given objectID.
 java.lang.Object getQueues(XATTree tree)
          Returns an ArrayList of XATQueryObjects (queues) that belong to the given tree.
 java.lang.Object getTree(java.lang.String objectID)
          Returns the XATTree with the given objectID.
 void setOperators(XATTree key, java.util.ArrayList ops)
          Puts the given tree's operators into the storage HashMap.
 void setQueues(XATTree key, java.util.ArrayList qs)
          Puts the given tree's queues into the storage HashMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeStorage

public TreeStorage()
Initializes the TreeStorage HashMap.

Method Detail

getOperator

public java.lang.Object getOperator(java.lang.String objectID)
Returns the XATStreamOperator with the given objectID.


getQueue

public java.lang.Object getQueue(java.lang.String objectID)
Returns the XATQueue with the given objectID. This unique id (i.e. T1_O3_Q0) is constructed by the string: "T" + TREE_ID + "_O" + OBJECT_ID + "_Q" + queueNumber.

Returns:
the queue with the given objectID

getTree

public java.lang.Object getTree(java.lang.String objectID)
Returns the XATTree with the given objectID.


getOperators

public java.lang.Object getOperators(XATTree tree)
Returns an ArrayList of XATQueryObjects (operators) that belong to the given tree.

Returns:
Object - java.util.ArrayList

getQueues

public java.lang.Object getQueues(XATTree tree)
Returns an ArrayList of XATQueryObjects (queues) that belong to the given tree.

Returns:
Object - java.util.ArrayList

getAllOperators

public java.util.Iterator getAllOperators()
Returns an Iterator of all the operators.

Returns:
java.util.Iterator

getAllQueues

public java.util.Iterator getAllQueues()
Returns an Iterator of all the queues.

Returns:
java.util.Iterator

getAllTrees

public java.util.Iterator getAllTrees()
Returns an Iterator of all the trees.

Returns:
java.util.Iterator

getKeys

public java.util.Set getKeys()
Returns a Set of keys (or XATTrees) of this HashMap.

Returns:
java.util.Set

setOperators

public void setOperators(XATTree key,
                         java.util.ArrayList ops)
Puts the given tree's operators into the storage HashMap.

Parameters:
key - - edu.wpi.cs.dsrg.xmldb.xat.common.treestructure.XATTree
ops - - java.util.ArrayList

setQueues

public void setQueues(XATTree key,
                      java.util.ArrayList qs)
Puts the given tree's queues into the storage HashMap.

Parameters:
key - - edu.wpi.cs.dsrg.xmldb.xat.common.treestructure.XATTree
qs - - java.util.ArrayList