com.adventnet.utils.btree
Class TreeFramework

java.lang.Object
  |
  +--com.adventnet.utils.btree.TreeFramework
Direct Known Subclasses:
AgentTree

public abstract class TreeFramework
extends java.lang.Object

The main Operations of TreeFramework which holds the Cells.

A Tree of TreeCells which can be acccessed as a part of the Runtime agent library for compiled agents with no MIB loaded.


Field Summary
(package private)  int elementCount
           
(package private)  TreeCell root
          This is the root node cell which is added
 
Constructor Summary
TreeFramework()
          The Default Constructor for TreeFrameWork.
 
Method Summary
 void addCell(TreeCell cell)
          Add a TreeCell.
 void addCell(TreeCell cell, TreeCell parent)
          add a TreeCell.
 void deleteCell(java.lang.Object key)
          delete the cell from the framework .
 void deleteCell(TreeCell toDelete)
          delete the cell from the framework.
 TreeCell getCell(java.lang.Object key)
          Getter for the tree cell corresponding to the key.
 java.util.Enumeration getElements()
          Getter for all elements in the tree.
 TreeCell getNextCell(java.lang.Object key)
          Getter for the next tree cell corresponding to the key.
 TreeCell getRoot()
          Getter for the root node
 void incrementElementCount()
          Counts number of cells added
 void setRoot(TreeCell root)
          Setter for the root node
 int size()
          Getter for the size of the TreeFramework.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

TreeCell root
This is the root node cell which is added

elementCount

int elementCount
Constructor Detail

TreeFramework

public TreeFramework()
The Default Constructor for TreeFrameWork.
Method Detail

setRoot

public void setRoot(TreeCell root)
Setter for the root node
Parameters:
root - the root cell.

getRoot

public TreeCell getRoot()
Getter for the root node
Returns:
the root cell

incrementElementCount

public void incrementElementCount()
Counts number of cells added

addCell

public void addCell(TreeCell cell)
             throws java.lang.ClassCastException
Add a TreeCell. Inserts this TreeCell at the appropriate place
Parameters:
cell - Thye cell to add.
Throws:
java.lang.ClassCastException - if it is not a AgentNode.

addCell

public void addCell(TreeCell cell,
                    TreeCell parent)
             throws java.lang.ClassCastException
add a TreeCell. Inserts this TreeCell at the appropriate place
Parameters:
cell - to add
parent - of the cell
Throws:
java.lang.ClassCastException - if it is not a AgentNode

size

public int size()
Getter for the size of the TreeFramework.
Returns:
size of TreeFramework

deleteCell

public void deleteCell(TreeCell toDelete)
delete the cell from the framework.

The delete method deletes all child TreeCells under the tree .

Parameters:
toDelete - the cell to delete

deleteCell

public void deleteCell(java.lang.Object key)
delete the cell from the framework .

The delete method deletes all child TreeCells under the tree.

Parameters:
key - depending on what is being stored

getCell

public TreeCell getCell(java.lang.Object key)
Getter for the tree cell corresponding to the key.
Parameters:
key - The Object key of the cell. Override this method if there are any specific considerations.
Returns:
The cell with the given key.

getNextCell

public TreeCell getNextCell(java.lang.Object key)
Getter for the next tree cell corresponding to the key.
Parameters:
key - The Object key of the cell.
Returns:
The cell with the given key.

getElements

public java.util.Enumeration getElements()
Getter for all elements in the tree.
Returns:
Enumeration of all elements in the TreeFramework