Package org.ehrbase.openehr.util
Class TreeUtils
java.lang.Object
org.ehrbase.openehr.util.TreeUtils
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TreeUtils
public TreeUtils()
-
-
Method Details
-
renderTree
public static <T extends TreeNode<T>> String renderTree(T root, Comparator<T> childOrder, Function<T, String> nodeRenderer) Draws a tree. One node per line. Indentation: 2 spaces- Type Parameters:
T-- Parameters:
root-childOrder- sort the children in the output. May help when comparing rendered trees.nodeRenderer- renders the contents of a node. Must not start with spaces or contain line breaks.- Returns:
-
parseTree
Parses a tree from a String. One node per line. Indentation: 2 spaces- Type Parameters:
T-- Parameters:
treeGraph-nodeParser- parses the contents of a node- Returns:
-