public interface Tree<T> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
T |
get(String name)
Retrieve a subtree by name.
|
List<T> |
getAllChildren()
Get the children, and their children, etc.
|
List<T> |
getAllChildren(boolean includeSelf)
Get all children, optional including self
|
T |
getChild(String name)
Get a subtree by name.
|
Vector<T> |
getChildren()
Get the children of this element.
|
String |
getName()
Retrieve the unique name of this tree element.
|
T |
getParent()
Retrieve the parent node of current element.
|
String |
getPath(String separator)
Translate the path of this subtree as a separated string.
|
T |
getRoot()
Get the root element of this tree.
|
Map<String,T> |
getTreeElements()
Retrieve all tree elements as map.
|
Object |
getValue()
Retrieve the value of this node/leaf
|
boolean |
hasChildren()
Retrieve wether this Tree has children
|
boolean |
hasParent()
Retrieve wether this Tree has a parent
|
void |
setParent(T parent)
Set the parent of current element (and move the children accordingly).
|
void |
setValue(Object o)
Set the value of this node/leaf
|
String |
toString()
Print the tree.
|
String |
toString(boolean includeSubTree,
int level)
Pretty print the (sub)tree, but only a certain levels
|
String getName()
T get(String name)
name - of the subtreeT getParent()
void setParent(T parent)
parent - to replace current parent of this.boolean hasParent()
T getRoot()
boolean hasChildren()
List<T> getAllChildren(boolean includeSelf)
T getChild(String name)
name - of the subtreeString toString()
String toString(boolean includeSubTree, int level)
includeSubTree - if true the subtree is also printedlevel - will print in so many levelsMap<String,T> getTreeElements()
Object getValue()
void setValue(Object o)
Copyright © 2015. All Rights Reserved.