class PrettyPrinter extends Object
Constructor and Description |
---|
PrettyPrinter()
Construct a PrettyPrinter with an indentation width of 2.
|
PrettyPrinter(int indentWidth)
Construct a PrettyPrinter given the indentation width.
|
Modifier and Type | Method and Description |
---|---|
void |
indentLeft()
Indent left.
|
void |
indentRight()
Indent right.
|
void |
print(String s)
Print the specified string to STDOUT.
|
void |
printf(String format,
Object... args)
Print args to STDOUT according to the pecified format.
|
void |
println()
Print an empty line to STDOUT.
|
void |
println(String s)
Print the specified string (followed by a newline) to STDOUT.
|
public PrettyPrinter()
public PrettyPrinter(int indentWidth)
indentWidth
- number of blank spaces for an indent.public void indentRight()
public void indentLeft()
public void println()
public void println(String s)
s
- string to print.public void print(String s)
s
- string to print.