|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gshute.trees.TreeNode
A TreeNode is a node in a binary tree.
Field Summary | |
java.lang.Object |
data
data is the data held by this node. |
TreeNode |
left
left is the left child of this node. |
TreeNode |
parent
parent is the parent of this node. |
TreeNode |
right
right is the right child of this node. |
Constructor Summary | |
TreeNode(java.lang.Object d)
new TreeNode(Object d) returns a new tree node with data d. |
Method Summary | |
void |
afterAdd(TreeEdge e)
n.afterAdd(e) performs modifications that are needed after n is added as the to node of e. |
void |
afterRemove(TreeEdge e)
n.afterRemove(e) performs modifications that are needed after n is removed as the to node of e. |
java.lang.Object |
getData()
n.getData() returns the data held by n. |
TreeNode |
getLeft()
n.getLeft() returns the left child of n. |
TreeNode |
getParent()
n.getParent() returns the parent of n. |
TreeNode |
getRight()
n.getRight() returns the right child of n. |
void |
preRotateLeft()
n.preRotateLeft() performs checks and modifications that are needed prior to a structural left rotation. |
void |
preRotateRight()
n.preRotateRight() performs checks and modifications that are needed prior to a structural right rotation. |
void |
setData(java.lang.Object d)
n.getData(d) sets the data held by n to d. |
void |
setLeft(TreeNode l)
n.setLeft(l) makes l the left child of n. |
void |
setRight(TreeNode r)
n.setRight(r) makes r the right child of n. |
java.lang.String |
toString()
n.toString() returns a string that describes n and its data. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public TreeNode left
public TreeNode right
public TreeNode parent
public java.lang.Object data
Constructor Detail |
public TreeNode(java.lang.Object d)
Method Detail |
public TreeNode getLeft()
public TreeNode getRight()
public TreeNode getParent()
public java.lang.Object getData()
public void setLeft(TreeNode l)
public void setRight(TreeNode r)
public void setData(java.lang.Object d)
public void preRotateLeft()
public void preRotateRight()
public void afterAdd(TreeEdge e)
public void afterRemove(TreeEdge e)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |