Class IndentablePrintStream

    • Constructor Detail

      • IndentablePrintStream

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

      • 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
      • printfIndentln

        public abstract IndentablePrintStream 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
      • lock

        public abstract void lock()
        Acquires a lock to prevent concurrent access to the IndentablePrintStream. This is useful if multiple threads are writing to the IndentablePrintStream.
      • unlock

        public abstract void unlock()
        Unlocks the lock.
      • runWithLock

        public abstract void runWithLock​(Runnable runnable)
        The given Runnable will be executed when the lock could be acquired.
        Parameters:
        runnable - should contain print statements