Class PrettyPrinter
java.lang.Object
com.googlecode.concurrenttrees.common.PrettyPrinter
Utility methods to generate semi-graphical string representations of trees.
- Author:
- Niall Gallagher
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringprettyPrint(PrettyPrintable tree) Generates a semi-graphical string representation of a given tree.static voidprettyPrint(PrettyPrintable tree, Appendable appendable) Generates a semi-graphical string representation of a given tree, writing it to a givenAppendable.
-
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
-