|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datastructures.BTNode<E>
public class BTNode<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 | |
---|---|
BTNode()
Default constructor |
|
BTNode(E element,
BTPosition<E> parent,
BTPosition<E> left,
BTPosition<E> right)
Main constructor |
Method Summary | |
---|---|
E |
element()
Returns the element stored at this position |
BTPosition<E> |
getLeft()
Returns the left child of this position |
BTPosition<E> |
getParent()
Returns the parent of this position |
BTPosition<E> |
getRight()
Returns the right child of this position |
void |
setElement(E o)
Sets the element stored at this position |
void |
setLeft(BTPosition<E> v)
Sets the left child of this position |
void |
setParent(BTPosition<E> v)
Sets the parent of this position |
void |
setRight(BTPosition<E> v)
Sets the right child of this position |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BTNode()
public BTNode(E element, BTPosition<E> parent, BTPosition<E> left, BTPosition<E> right)
Method Detail |
---|
public E element()
element
in interface Position<E>
public void setElement(E o)
setElement
in interface BTPosition<E>
public BTPosition<E> getLeft()
getLeft
in interface BTPosition<E>
public void setLeft(BTPosition<E> v)
setLeft
in interface BTPosition<E>
public BTPosition<E> getRight()
getRight
in interface BTPosition<E>
public void setRight(BTPosition<E> v)
setRight
in interface BTPosition<E>
public BTPosition<E> getParent()
getParent
in interface BTPosition<E>
public void setParent(BTPosition<E> v)
setParent
in interface BTPosition<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |