Class PrettyPrinter
- java.lang.Object
-
- com.googlecode.concurrenttrees.common.PrettyPrinter
-
public class PrettyPrinter extends java.lang.ObjectUtility methods to generate semi-graphical string representations of trees.
-
-
Constructor Summary
Constructors Constructor Description PrettyPrinter()Private constructor, not used.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidprettyPrint(Node node, java.lang.Appendable sb, java.lang.String prefix, boolean isTail, boolean isRoot)static java.lang.StringprettyPrint(PrettyPrintable tree)Generates a semi-graphical string representation of a given tree.static voidprettyPrint(PrettyPrintable tree, java.lang.Appendable appendable)Generates a semi-graphical string representation of a given tree, writing it to a givenAppendable.
-
-
-
Method Detail
-
prettyPrint
public static java.lang.String prettyPrint(PrettyPrintable tree)
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
public static void prettyPrint(PrettyPrintable tree, java.lang.Appendable appendable)
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
static void prettyPrint(Node node, java.lang.Appendable sb, java.lang.String prefix, boolean isTail, boolean isRoot)
-
-