Package org.apache.bsf.util

# Class IndentWriter

java.lang.Object
java.io.Writer
java.io.PrintWriter
org.apache.bsf.util.IndentWriter

All Implemented Interfaces:
  `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`

public class IndentWriter extends PrintWriter
An `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.

Author:
  Matthew J. Duftler

- ## Field Summary

  ### Fields inherited from class java.io.PrintWriter

  `out`

  ### Fields inherited from class java.io.Writer

  `lock`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IndentWriter(OutputStream out)`
  Forwards its arguments to the `PrintWriter` constructor with the same signature.
  `IndentWriter(OutputStream out, boolean autoFlush)`
  Forwards its arguments to the `PrintWriter` constructor with the same signature.
  `IndentWriter(Writer out)`
  Forwards its arguments to the `PrintWriter` constructor with the same signature.
  `IndentWriter(Writer out, boolean autoFlush)`
  Forwards its arguments to the `PrintWriter` constructor with the same signature.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `print(int numberOfSpaces, String text)`
  Print the text (indented the specified amount) without inserting a linefeed.
  `void`
  `println(int numberOfSpaces, 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`

  ### Methods inherited from class java.io.Writer

  `nullWriter`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### IndentWriter

    public IndentWriter(OutputStream out)
    Forwards its arguments to the `PrintWriter` constructor with the same signature.

  - ### IndentWriter

    public IndentWriter(OutputStream out, boolean autoFlush)
    Forwards its arguments to the `PrintWriter` constructor with the same signature.

  - ### IndentWriter

    public IndentWriter(Writer out)
    Forwards its arguments to the `PrintWriter` constructor with the same signature.

  - ### IndentWriter

    public IndentWriter(Writer out, boolean autoFlush)
    Forwards its arguments to the `PrintWriter` constructor with the same signature.

- ## Method Details

  - ### print

    public void print(int numberOfSpaces, 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, 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.