Package org.opencms.util
Class CmsTreeNode<T>
java.lang.Object
org.opencms.util.CmsTreeNode<T>
- Type Parameters:
T
- the type of data associated with the tree node
Generic tree node which can contain an object of generic type T as data, and which has a mutable list
of child nodes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(CmsTreeNode<T> cmsTreeNode) Adds a child node.void
addDataInPreOrder
(List<T> result) Adds the enclosed data of this node and its children to the given list, in preorder.List<CmsTreeNode<T>>
Gets the (mutable) list of child nodes.getData()
Gets the data associated with this node.void
Sets the data for this node.
-
Constructor Details
-
CmsTreeNode
public CmsTreeNode()
-
-
Method Details
-
addChild
Adds a child node.- Parameters:
cmsTreeNode
- the child node to add
-
addDataInPreOrder
Adds the enclosed data of this node and its children to the given list, in preorder.- Parameters:
result
- the list to add the data to
-
getChildren
Gets the (mutable) list of child nodes.- Returns:
- the list of child nodes
-
getData
Gets the data associated with this node.- Returns:
- the data for this node
-
setData
Sets the data for this node.- Parameters:
data
- the data to set
-