public class IndentWriter
extends java.io.PrintWriter
IndentWriter
object behaves the same as a
PrintWriter
object, with the additional capability
of being able to print strings that are prepended with a specified
amount of spaces.Constructor and Description |
---|
IndentWriter(java.io.OutputStream out)
Forwards its arguments to the
PrintWriter constructor
with the same signature. |
IndentWriter(java.io.OutputStream out,
boolean autoFlush)
Forwards its arguments to the
PrintWriter constructor
with the same signature. |
IndentWriter(java.io.Writer out)
Forwards its arguments to the
PrintWriter constructor
with the same signature. |
IndentWriter(java.io.Writer out,
boolean autoFlush)
Forwards its arguments to the
PrintWriter constructor
with the same signature. |
Modifier and Type | Method and Description |
---|---|
void |
print(int numberOfSpaces,
java.lang.String text)
Print the text (indented the specified amount) without inserting a linefeed.
|
void |
println(int numberOfSpaces,
java.lang.String text)
Print the text (indented the specified amount) and insert a linefeed.
|
append, append, append, append, append, append, append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
public IndentWriter(java.io.OutputStream out)
PrintWriter
constructor
with the same signature.public IndentWriter(java.io.OutputStream out, boolean autoFlush)
PrintWriter
constructor
with the same signature.public IndentWriter(java.io.Writer out)
PrintWriter
constructor
with the same signature.public IndentWriter(java.io.Writer out, boolean autoFlush)
PrintWriter
constructor
with the same signature.public void print(int numberOfSpaces, java.lang.String text)
numberOfSpaces
- the number of spaces to indent the text.text
- the text to print.public void println(int numberOfSpaces, java.lang.String text)
numberOfSpaces
- the number of spaces to indent the text.text
- the text to print.