|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.viz.plotter.dendrogram.BinaryTreeNode<T>
T
- the type of the nodes content.public class BinaryTreeNode<T>
A generic tree with a content, a reference to the parent node and with a left
child and a right child. Everything might be null
except of the
content, i.e. the children and the parent might be added later but only
once.
Nodes without children are considered ot be leaf nodes, i.e.
isLeaf()
returns true
.
Constructor Summary | |
---|---|
BinaryTreeNode(T content)
The content of a BinaryTreeNode is final and is set only
once. |
Method Summary | |
---|---|
T |
getContent()
|
BinaryTreeNode<T> |
getLeftChild()
|
BinaryTreeNode<T> |
getParent()
|
BinaryTreeNode<T> |
getRightChild()
|
boolean |
isLeaf()
|
void |
setLeftChild(BinaryTreeNode<T> leftChild)
The parent of the node can be set only once, if the left child is already set an IllegalArgumentException is thrown. |
void |
setParent(BinaryTreeNode<T> parent)
The parent of the node can be set only once, if the parent is already set an IllegalArgumentException is thrown. |
void |
setRightChild(BinaryTreeNode<T> rightChild)
* The parent of the node can be set only once, if the right child is already set an IllegalArgumentException is thrown. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BinaryTreeNode(T content)
BinaryTreeNode
is final and is set only
once.
content
- the content of the node.Method Detail |
---|
public T getContent()
public BinaryTreeNode<T> getParent()
public void setParent(BinaryTreeNode<T> parent)
IllegalArgumentException
is thrown.
parent
- the parent of this node.
IllegalArgumentException
- if the parent is already set.public BinaryTreeNode<T> getLeftChild()
public void setLeftChild(BinaryTreeNode<T> leftChild)
IllegalArgumentException
is thrown.
leftChild
- the left child of this node
IllegalArgumentException
- if the left child is already set.public BinaryTreeNode<T> getRightChild()
public void setRightChild(BinaryTreeNode<T> rightChild)
IllegalArgumentException
is thrown.
rightChild
- the right child.
IllegalArgumentException
- if the right child is already set.public boolean isLeaf()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |