T - Type of data to hold in the node.public static class TestSpanTree.TreeNode<T> extends Object implements ConsumableTree<T>
| Constructor and Description |
|---|
TreeNode(T nodeData,
TestSpanTree.TreeNode<T>... newChildren)
Create a new node.
|
| Modifier and Type | Method and Description |
|---|---|
TestSpanTree.TreeNode<T> |
addChild(TestSpanTree.TreeNode<T> child)
Add new child to this node.
|
boolean |
equals(Object obj) |
List<TestSpanTree.TreeNode<T>> |
getChildren()
Return the child nodes.
|
T |
getData()
Return the data in the node.
|
int |
hashCode() |
String |
toJSON(String nodeName,
int indentationLevel,
String indentationCharacters)
Return JSON representation.
|
String |
toString() |
void |
visitTree(Consumer<? super T> visitor)
Recursively visit all nodes with the lambda.
|
@SafeVarargs public TreeNode(T nodeData, TestSpanTree.TreeNode<T>... newChildren)
nodeData - Data held in the node.newChildren - Child nodespublic T getData()
public List<TestSpanTree.TreeNode<T>> getChildren()
public TestSpanTree.TreeNode<T> addChild(TestSpanTree.TreeNode<T> child)
child - Child to add.public String toJSON(String nodeName, int indentationLevel, String indentationCharacters)
nodeName - Node name to display in JSON.indentationLevel - How many instances of indentationCharactersindentationCharacters - The indentation characters to usepublic void visitTree(Consumer<? super T> visitor)
visitTree in interface ConsumableTree<T>visitor - LambdaCopyright © 2017 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.