public class BTNode<E> extends java.lang.Object implements BTPosition<E>
Constructor and Description |
---|
BTNode()
Default constructor
|
BTNode(E element,
BTPosition<E> parent,
BTPosition<E> left,
BTPosition<E> right)
Main constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
public BTNode()
public BTNode(E element, BTPosition<E> parent, BTPosition<E> left, BTPosition<E> right)
public E element()
public BTPosition<E> getLeft()
getLeft
in interface BTPosition<E>
public BTPosition<E> getParent()
getParent
in interface BTPosition<E>
public BTPosition<E> getRight()
getRight
in interface BTPosition<E>
public void setElement(E o)
setElement
in interface BTPosition<E>
public void setLeft(BTPosition<E> v)
setLeft
in interface BTPosition<E>
public void setParent(BTPosition<E> v)
setParent
in interface BTPosition<E>
public void setRight(BTPosition<E> v)
setRight
in interface BTPosition<E>