|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.datastructures.TreeNode<E>
public class TreeNode<E>
Class implementing a node of a binary tree by storing references to an element, a parent node, a left node, and a right node.
| Constructor Summary | |
|---|---|
TreeNode()
Default constructor |
|
TreeNode(E element,
TreePosition<E> parent,
PositionList<Position<E>> children)
Main constructor |
|
| Method Summary | |
|---|---|
E |
element()
Returns the element stored at this position |
PositionList<Position<E>> |
getChildren()
Returns the children of this position |
TreePosition<E> |
getParent()
Returns the parent of this position |
void |
setChildren(PositionList<Position<E>> c)
Sets the right child of this position |
void |
setElement(E o)
Sets the element stored at this position |
void |
setParent(TreePosition<E> v)
Sets the parent of this position |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeNode()
public TreeNode(E element,
TreePosition<E> parent,
PositionList<Position<E>> children)
| Method Detail |
|---|
public E element()
element in interface Position<E>public void setElement(E o)
setElement in interface TreePosition<E>public PositionList<Position<E>> getChildren()
getChildren in interface TreePosition<E>public void setChildren(PositionList<Position<E>> c)
setChildren in interface TreePosition<E>public TreePosition<E> getParent()
getParent in interface TreePosition<E>public void setParent(TreePosition<E> v)
setParent in interface TreePosition<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||