com.adventnet.utils.btree
Class TreeCell

java.lang.Object
  |
  +--com.adventnet.utils.btree.TreeCell
Direct Known Subclasses:
AgentNode

public abstract class TreeCell
extends java.lang.Object

This class is used to store the PduRequestListener information. AgentNode extends this class.

See Also:
AgentNode

Field Summary
(package private)  java.lang.Object key
           
(package private)  TreeCell parent
           
(package private)  boolean proxy
           
(package private)  int subId
          SubIdentifier for this node
 
Constructor Summary
TreeCell(TreeFramework frm, java.lang.Object k, int id)
          Contructor with the FrameWork , key and subId.
 
Method Summary
 void addCell(TreeCell child)
          add the child to the appropriate position in the subTree
abstract  int compareTo(java.lang.Object toCompare)
          Compare the given key with this key.
 int compareTo(TreeCell cell1)
          Compare this cell with another TreeCell.
 java.util.Vector getChildList()
          Getter for childList This is a Vector of children (TreeCell )
 java.lang.Object getKey()
          Getter key of the TreeCell
 int getLevel()
          It is used to retrive the level of the cell where it is situated.
 TreeCell getNextCell()
          Gets the Next LexicoGraphically ordered Cell
 TreeCell getNextLeafCell()
          Getter for next leaf tree cell
 TreeCell getParent()
          Retrieves the parent of the cell.
 int getSubId()
          Getter of subid.
 TreeFramework getTreeFramework()
          Getter for the TreeFramework
 boolean isLeaf()
          Checks if there are any children to this Cell
 boolean isProxy()
          Checks whether the cell is a proxy cell.
 void setParent(TreeCell par)
          Setter for the parent of this TreeCell.
 void setProxy(boolean proxy)
          sets the cell to act as a proxy cell.
 void setSubId(int id)
          Setter for subID.
 java.lang.String toString()
          Getter for string representation of the key.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

TreeCell parent

subId

int subId
SubIdentifier for this node

proxy

boolean proxy

key

java.lang.Object key
Constructor Detail

TreeCell

public TreeCell(TreeFramework frm,
                java.lang.Object k,
                int id)
Contructor with the FrameWork , key and subId.
Parameters:
frm - TreeFramework to which this cell belongs
k - which represents this Object
id - the subid
Method Detail

getParent

public TreeCell getParent()
Retrieves the parent of the cell.
Returns:
the parent of this TreeCell.

setParent

public void setParent(TreeCell par)
Setter for the parent of this TreeCell.
Parameters:
par - The parent to be set.

getLevel

public int getLevel()
It is used to retrive the level of the cell where it is situated.
Returns:
the level at which this Cell is situated

setSubId

public void setSubId(int id)
Setter for subID.
Parameters:
id - the subid value

getSubId

public int getSubId()
Getter of subid.
Returns:
the SubId associated with this TreeCell

getTreeFramework

public TreeFramework getTreeFramework()
Getter for the TreeFramework
Returns:
the TreeFrameWork

getChildList

public java.util.Vector getChildList()
Getter for childList This is a Vector of children (TreeCell )
Returns:
childList

getNextCell

public TreeCell getNextCell()
Gets the Next LexicoGraphically ordered Cell
Returns:
next TreeCell

getNextLeafCell

public TreeCell getNextLeafCell()
Getter for next leaf tree cell
Returns:
the nextLeafCell

isLeaf

public boolean isLeaf()
Checks if there are any children to this Cell
Returns:
true if there are children else returns false

isProxy

public boolean isProxy()
Checks whether the cell is a proxy cell.

If the subidlist of the cell is int[] = {-1} , then the cell is considered as a proxy cell.

Returns:
true if the cell is a proxy cell.

setProxy

public void setProxy(boolean proxy)
sets the cell to act as a proxy cell.
Parameters:
proxy - the boolean value to set as a proxy cell.

getKey

public java.lang.Object getKey()
Getter key of the TreeCell
Returns:
the key associated with this TreeCell

toString

public java.lang.String toString()
Getter for string representation of the key.
Overrides:
toString in class java.lang.Object
Returns:
the String representation of the key

compareTo

public int compareTo(TreeCell cell1)
Compare this cell with another TreeCell.
Parameters:
cell1 - the cell to compare.
Returns:
-1 If the cell is lesser than the TreeCell, 0 If they were Equal, 1 If the cell is greater than the TreeCell.

compareTo

public abstract int compareTo(java.lang.Object toCompare)
Compare the given key with this key.
Parameters:
toCompare - The Key to be compared.
Returns:
1 if greaterThan,
-1 if lessThan,
0 if key equals the TreeCell being passed.

addCell

public void addCell(TreeCell child)
add the child to the appropriate position in the subTree
Parameters:
child - the TreeCell to add.