Package org.ehrbase.openehr.util
Class TreeNode<T extends TreeNode<T>>
java.lang.Object
org.ehrbase.openehr.util.TreeNode<T>
- Type Parameters:
T-
- Direct Known Subclasses:
PathCohesionAnalysis.PathCohesionTreeNode
A simple base for creating tree structures.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TAdd the child to children.voidsortChildren(Comparator<T> comparator)
-
Field Details
-
parent
-
-
Constructor Details
-
TreeNode
public TreeNode()
-
-
Method Details
-
getParent
-
addChild
Add the child to children. If it is already contained, nothing is changed. If it already has a parent, it is removed from the parent. In order to keep the tree acyclic, a IllegalArgumentException is thrown if the child ia an ancestor of this node.- Parameters:
child-- Returns:
-
getChildren
-
sortChildren
-
streamDepthFirst
-