public interface TreeNode<T extends TreeNode>
Modifier and Type | Method and Description |
---|---|
T |
getChild(String name)
Get child by name, in relation to this node.
|
Iterable<T> |
getChildren()
Get immediate children of this node.
|
Iterable<T> |
getDescendants()
Get all descendants of this node.
|
T[] |
getFullPath()
Get the full path of this node, from the root node.
|
String |
getName()
Get the name of this node, in relation to the parent.
|
T |
getParent()
Returns the parent node.
|
boolean |
hasChild(String name)
Returns whether the child node exists.
|
boolean |
hasChildren()
Returns whether this node has any child nodes.
|
String getName()
T[] getFullPath()
T getParent()
boolean hasChildren()
boolean hasChild(String name)
T getChild(String name)
If the child does not already exist, a new one shall be automatically created.
If this is not the preferred behavior, you should use hasChild(String)
first.
Iterable<T> getChildren()
This does not include grandchildren (use getDescendants()
instead).
Iterable<T> getDescendants()
This includes grandchildren, great-grandchildren, etc (use getChildren()
if you just
want the immediate children).
Copyright © 2015. All Rights Reserved.