|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--asd_library.tree.tree.TreeNode
Basic node stored in a binary search tree.
Field Summary | |
TreeNode |
firstChild
The first child node of current node. |
java.lang.Comparable |
key
The key of the node. |
TreeNode |
nextSibling
The next sibling of current node |
TreeNode |
parent
The parent of this node |
Constructor Summary | |
TreeNode()
Constructs a new node. |
|
TreeNode(java.lang.Comparable el)
Constructs a new node. |
|
TreeNode(java.lang.Comparable el,
TreeNode par,
TreeNode fc,
TreeNode ns)
Constructs a new node. |
Method Summary | |
TreeNode |
getFirstChild()
Returns the first child of the node. |
java.lang.Comparable |
getKey()
Returns the key of the node. |
TreeNode |
getNextSibling()
Returns the next sibling of the node. |
TreeNode |
getParent()
Returns the parent of the node. |
boolean |
isLeaf()
Verifies if this TreeNode is a leaf. |
void |
setParent(TreeNode par)
Sets the parent of this node to be the specified node. |
void |
visit()
Prints the String that represents the key of hte node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.Comparable key
public TreeNode firstChild
public TreeNode nextSibling
public TreeNode parent
Constructor Detail |
public TreeNode()
public TreeNode(java.lang.Comparable el)
el
- the element to insert.public TreeNode(java.lang.Comparable el, TreeNode par, TreeNode fc, TreeNode ns)
el
- the element to insert.par
- the parent of this node.fc
- the first child of this node.ns
- the next sibling of this node.Method Detail |
public java.lang.Comparable getKey()
public TreeNode getFirstChild()
public TreeNode getNextSibling()
public TreeNode getParent()
public void setParent(TreeNode par)
par
- what the parent field is to be set to.public void visit()
public boolean isLeaf()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |