Package org.apache.bsf.util
Class IndentWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- org.apache.bsf.util.IndentWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class IndentWriter extends java.io.PrintWriter
AnIndentWriter
object behaves the same as aPrintWriter
object, with the additional capability of being able to print strings that are prepended with a specified amount of spaces.- Author:
- Matthew J. Duftler
-
-
Constructor Summary
Constructors Constructor Description IndentWriter(java.io.OutputStream out)
Forwards its arguments to thePrintWriter
constructor with the same signature.IndentWriter(java.io.OutputStream out, boolean autoFlush)
Forwards its arguments to thePrintWriter
constructor with the same signature.IndentWriter(java.io.Writer out)
Forwards its arguments to thePrintWriter
constructor with the same signature.IndentWriter(java.io.Writer out, boolean autoFlush)
Forwards its arguments to thePrintWriter
constructor with the same signature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class java.io.PrintWriter
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
-
-
-
-
Constructor Detail
-
IndentWriter
public IndentWriter(java.io.OutputStream out)
Forwards its arguments to thePrintWriter
constructor with the same signature.
-
IndentWriter
public IndentWriter(java.io.OutputStream out, boolean autoFlush)
Forwards its arguments to thePrintWriter
constructor with the same signature.
-
IndentWriter
public IndentWriter(java.io.Writer out)
Forwards its arguments to thePrintWriter
constructor with the same signature.
-
IndentWriter
public IndentWriter(java.io.Writer out, boolean autoFlush)
Forwards its arguments to thePrintWriter
constructor with the same signature.
-
-
Method Detail
-
print
public void print(int numberOfSpaces, java.lang.String text)
Print the text (indented the specified amount) without inserting a linefeed.- Parameters:
numberOfSpaces
- the number of spaces to indent the text.text
- the text to print.
-
println
public void println(int numberOfSpaces, java.lang.String text)
Print the text (indented the specified amount) and insert a linefeed.- Parameters:
numberOfSpaces
- the number of spaces to indent the text.text
- the text to print.
-
-