Package io.jmix.core.common.datastruct
Class Tree<T>
java.lang.Object
io.jmix.core.common.datastruct.Tree<T>
- Type Parameters:
T
- type of tree node data
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the first root Node of the tree.Return the root nodes of the tree.void
setRootNodes
(List<Node<T>> rootNodes) Set the root Element for the tree.toList()
Returns theTree<T>
as a List ofNode<T>
objects.toString()
Returns a String representation of the Tree.
-
Constructor Details
-
Tree
public Tree() -
Tree
-
Tree
-
-
Method Details
-
getRootNode
Return the first root Node of the tree.- Returns:
- the root element.
-
getRootNodes
Return the root nodes of the tree.- Returns:
- the root elements.
-
setRootNodes
Set the root Element for the tree.- Parameters:
rootNodes
- the root element to set.
-
toList
Returns theTree<T>
as a List ofNode<T>
objects. The elements of the List are generated from a pre-order traversal of the tree.- Returns:
- a
List<Node<T>>
.
-
toString
Returns a String representation of the Tree. The elements are generated from a pre-order traversal of the Tree.
-