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.
|
List<ITreeNode<T>> |
getChildren() |
ITreeNode<T> |
getParent() |
T |
getValue() |
String |
toString() |
public TreeNode(T item)
item
- node payloadpublic 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 addpublic void detach()
Copyright © 2019. All rights reserved.