Class IndentablePrintStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
de.christofreichardt.diagnosis.io.IndentablePrintStream
All Implemented Interfaces:
Indentable, Closeable, Flushable, Appendable, AutoCloseable
Direct Known Subclasses:
NullPrintStream, TracePrintStream

public abstract class IndentablePrintStream extends PrintStream implements Indentable
The base class of all indentable print streams.
Author:
Christof Reichardt
  • Constructor Details

    • IndentablePrintStream

      public IndentablePrintStream(OutputStream out)
      This constructor passes the given OutputStream to the underlying PrintStream implementation.
      Parameters:
      out - the desired OutputStream
  • Method Details

    • printIndent

      public abstract IndentablePrintStream printIndent(String s)
      Description copied from interface: Indentable
      Prints an indented string.
      Specified by:
      printIndent in interface Indentable
      Parameters:
      s - the string to be printed
      Returns:
      the indentable stream itself
    • printIndentln

      public abstract IndentablePrintStream printIndentln(String s)
      Description copied from interface: Indentable
      Prints an indented string together with a line feed.
      Specified by:
      printIndentln in interface Indentable
      Parameters:
      s - the string to be printed
      Returns:
      the indentable stream itself
    • printIndentString

      public abstract IndentablePrintStream printIndentString()
      Description copied from interface: Indentable
      Prints only the current indentation.
      Specified by:
      printIndentString in interface Indentable
      Returns:
      the indentable stream itself
    • printfIndentln

      public abstract Indentable printfIndentln(String format, Object... args)
      Description copied from interface: Indentable
      A convenience method to print an indented string onto the stream using the specified format string and the given arguments.
      Specified by:
      printfIndentln in interface Indentable
      Parameters:
      format - the format string
      args - the to be printed arguments
      Returns:
      the indentable stream itself