|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.joensuu.cs.tra.BTreeNode<E>
public class BTreeNode<E>
BTreeNode is a building block for basic
BTree
s.
BTree
Constructor Summary | |
---|---|
BTreeNode(E element)
Creates a new BTreeNode with the specified element. |
Method Summary | |
---|---|
int |
getBalance()
Returns this node's balance. |
E |
getElement()
Returns this node's element. |
BTreeNode<E> |
getLeftChild()
Returns this node's leftmost child. |
BTreeNode<E> |
getParent()
Returns this node's parent node. |
BTreeNode<E> |
getRightChild()
Returns this node's right child. |
void |
removeLeftChild()
Removes this node's left child. |
void |
removeRightChild()
Removes this node's right child. |
void |
setBalance(int balance)
Sets this node's balance. |
E |
setElement(E element)
Sets this node's element. |
void |
setLeftChild(BTree<E> tree)
Sets this node's left child to be the root node of the specified BTree. |
void |
setLeftChild(BTreeNode<E> node)
Sets this node's left child. |
void |
setRightChild(BTree<E> tree)
Sets this node's right child to be the root node of the specified BTree . |
void |
setRightChild(BTreeNode<E> node)
Sets this node's right child. |
String |
toString()
Returns (element) as String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BTreeNode(E element)
element
- the element for the BTreeNode.Method Detail |
---|
public void setBalance(int balance)
balance
- the new balance for this node.public int getBalance()
public E getElement()
public E setElement(E element)
element
- new element for this node.
ElementTypeMismatchException
- if the type of element
does not match that of this node.public BTreeNode<E> getParent()
BTree
.public BTreeNode<E> getLeftChild()
public void setLeftChild(BTreeNode<E> node)
node
- the new left child.
NullPointerException
- if node is null.
ElementTypeMismatchException
- if node's element type does
not match that of this node.public void setLeftChild(BTree<E> tree)
tree
- the BTree
the root node of which is
to be this node's left child.
NullPointerException
- if tree or its root node is
null.
ElementTypeMismatchException
- if tree's element type does
not match that of this node.public void removeLeftChild()
public BTreeNode<E> getRightChild()
public void setRightChild(BTreeNode<E> node)
node
- the new right child.
NullPointerException
- if node is null.
BTreeException
- if this node is the root node.public void setRightChild(BTree<E> tree)
BTree
.
tree
- the BTree
the root node of which is
to become this node's right child.
NullPointerException
- if tree or its root node is
null.
ElementTypeMismatchException
- if tree's element type does
not match that of this node.public void removeRightChild()
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |