| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ITreeNode<T>> |
children |
private T |
item |
private TreeNode<T> |
parent |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ITreeVisitor<T> visitor) |
void |
addChild(TreeNode<T> node)
Add a child node.
|
void |
detach()
Detach this node from its parent.
|
java.util.List<ITreeNode<T>> |
getChildren() |
ITreeNode<T> |
getParent() |
T |
getValue() |
(package private) void |
removeChild(TreeNode<T> node)
Remove a child node.
|
(package private) void |
setItem(T item)
Set the node payload.
|
java.lang.String |
toString() |
private T item
public TreeNode(T item)
item - node payloadpublic java.util.List<ITreeNode<T>> getChildren()
getChildren in interface ITreeNode<T>public T getValue()
public void accept(ITreeVisitor<T> visitor)
public void addChild(TreeNode<T> node)
node - child node to addvoid removeChild(TreeNode<T> node)
node - child node to removevoid setItem(T item)
item - new node payloadpublic java.lang.String toString()
toString in class java.lang.Objectpublic void detach()