public class TreeNode<E> extends java.lang.Object implements TreePosition<E>
Constructor and Description |
---|
TreeNode()
Default constructor
|
TreeNode(E element,
TreePosition<E> parent,
PositionList<Position<E>> children)
Main constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
public TreeNode()
public TreeNode(E element, TreePosition<E> parent, PositionList<Position<E>> children)
public E element()
public PositionList<Position<E>> getChildren()
getChildren
in interface TreePosition<E>
public TreePosition<E> getParent()
getParent
in interface TreePosition<E>
public void setChildren(PositionList<Position<E>> c)
setChildren
in interface TreePosition<E>
public void setElement(E o)
setElement
in interface TreePosition<E>
public void setParent(TreePosition<E> v)
setParent
in interface TreePosition<E>