public final class TreePrinter extends Object
print
a tree for debug purposes.Modifier | Constructor and Description |
---|---|
private |
TreePrinter() |
Modifier and Type | Method and Description |
---|---|
private static <T> void |
_print(StringBuilder sb,
AbstractTreeNode<T> tree,
Function<T,String> leafStringifier,
StringBuffer prefix,
boolean isTail) |
static <T> String |
print(AbstractTreeNode<T> tree)
Prints the given tree
Use for debug purposes only. |
static <T> String |
print(AbstractTreeNode<T> tree,
Function<T,String> leafStringifier)
Prints the given tree
Use for debug purposes only. |
private TreePrinter()
public static <T> String print(AbstractTreeNode<T> tree)
T
- the type of the values of the leaves of the tree.tree
- The tree to printpublic static <T> String print(AbstractTreeNode<T> tree, Function<T,String> leafStringifier)
T
- the type of the values of the leaves of the tree.tree
- The tree to printleafStringifier
- The function to transform a leaf value to a readable Stringprivate static <T> void _print(StringBuilder sb, AbstractTreeNode<T> tree, Function<T,String> leafStringifier, StringBuffer prefix, boolean isTail)