Class TracePrintStream

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

public class TracePrintStream extends IndentablePrintStream
This is the main implementation of an indentable PrintStream. This stream uses a thread map to retrieve the current stack size and computes the extend of the indentation accordingly.
Author:
Christof Reichardt
  • Field Details

    • MAX_INDENT_NUMBER

      public static final int MAX_INDENT_NUMBER
      indicates the maximum number of indentations
      See Also:
    • INDENT_CHAR_NUMBER

      public static final int INDENT_CHAR_NUMBER
      number of spaces that should used per indentation
      See Also:
    • INDENT_STRING

      protected static final String[] INDENT_STRING
      string array that contains the indent strings
    • threadMap

      protected final AbstractThreadMap threadMap
      provides access to the tracing contexts indexed by thread objects
  • Constructor Details

    • TracePrintStream

      public TracePrintStream()
      Creates a new instance by passing a NullOutputStream to the base class.
    • TracePrintStream

      public TracePrintStream(OutputStream out, AbstractThreadMap threadMap)
      Creates a new instance of TracePrintStream by passing the given OutputStream to the underlying PrintStream. The threadMap will be needed to determine the current stack size and hence the indentation level.
      Parameters:
      out - the underlying OutputStream
      threadMap - to compute the indentation level
  • Method Details