Class PrettyPrinter
java.lang.Object
com.googlecode.concurrenttrees.common.PrettyPrinter
Utility methods to generate semi-graphical string representations of trees.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
prettyPrint
(Node node, Appendable sb, String prefix, boolean isTail, boolean isRoot) static String
prettyPrint
(PrettyPrintable tree) Generates a semi-graphical string representation of a given tree.static void
prettyPrint
(PrettyPrintable tree, Appendable appendable) Generates a semi-graphical string representation of a given tree, writing it to a givenAppendable
.
-
Constructor Details
-
PrettyPrinter
PrettyPrinter()Private constructor, not used.
-
-
Method Details
-
prettyPrint
Generates a semi-graphical string representation of a given tree. Example output:
○ └── ○ B (1) └── ○ A (2) └── ○ N (3) ├── ○ AN (5) │ └── ○ A (6) └── ○ DANA (4)
- Parameters:
tree
- The tree for which the semi-graphical representation should be generated- Returns:
- A semi-graphical string representation of the tree
-
prettyPrint
Generates a semi-graphical string representation of a given tree, writing it to a givenAppendable
. Example output:
○ └── ○ B (1) └── ○ A (2) └── ○ N (3) ├── ○ AN (5) │ └── ○ A (6) └── ○ DANA (4)
- Parameters:
tree
- The tree for which the semi-graphical representation should be generatedappendable
- The object to which the tree should be written
-
prettyPrint
-