java.io.Closeable
, java.io.Flushable
, java.lang.Appendable
, java.lang.AutoCloseable
public class IndentWriter
extends java.io.PrintWriter
Constructor | Description |
---|---|
IndentWriter(java.io.PrintWriter pw) |
|
IndentWriter(java.io.PrintWriter pw,
int indentation) |
Create an IndentWriter.
|
Modifier and Type | Method | Description |
---|---|---|
void |
indent() |
Increase the indentation.
|
void |
println(java.lang.Object line) |
|
void |
println(java.lang.String line) |
|
void |
unindent() |
Decrease the indentation and write an empty line.
|
public IndentWriter(java.io.PrintWriter pw, int indentation)
pw
- the parent writerindentation
- number of spaces of indentation (default value of 2 spaces)public IndentWriter(java.io.PrintWriter pw)
public void println(java.lang.Object line)
println
in class java.io.PrintWriter
public void println(java.lang.String line)
println
in class java.io.PrintWriter
public void indent()
public void unindent()