|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BinaryTreeBasis<T>
public abstract class BinaryTreeBasis<T>
Constructor Summary | |
---|---|
BinaryTreeBasis()
Constructor for BinaryTreeBasis |
|
BinaryTreeBasis(T rootItem)
Constructor for BinaryTreeBasis |
Method Summary | |
---|---|
TreeNode<T> |
getRoot()
A getter for the root node of this BinaryTreeBasis |
T |
getRootItem()
This method is used to obtain the data item contained in the root node. |
boolean |
isEmpty()
This method is used to check if the BinaryTreeBasis is empty. |
void |
makeEmpty()
This method will set the root to null , making the BinaryTreeBasis
empty. |
void |
setRoot(TreeNode<T> root)
A setter for the root node of this BinaryTreeBasis |
abstract void |
setRootItem(T newItem)
This method is used to set the data item to be contained in the root node. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryTreeBasis()
BinaryTreeBasis
public BinaryTreeBasis(T rootItem)
BinaryTreeBasis
rootItem
- The data item that will be contained
by the root of this BinaryTreeBasis
Method Detail |
---|
public boolean isEmpty()
BinaryTreeBasis
is empty.
true
if the root
is null
, otherwise
it returns false
public void makeEmpty()
root
to null
, making the BinaryTreeBasis
empty.
public T getRootItem() throws TreeException
TreeException
- This exception is thrown if the root node is null
public abstract void setRootItem(T newItem)
newItem
- the data item to be contained in the root node.public TreeNode<T> getRoot()
BinaryTreeBasis
BinaryTreeBasis
public void setRoot(TreeNode<T> root)
BinaryTreeBasis
root
- The new root node of this BinaryTreeBasis
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |