Class IndentedPrintStream

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void align​(Object... s)
      Takes an array of strings to be aligned in separate columns, and adds them to the alignedblock
      void closeBlock()
      Outdents the line and prints a close curly bracket on the following line
      void closeBlock​(String s)
      Outdents the current line and prints a close curly bracket on the next line, followed by a string
      void continueBlock​(String s)
      Ends one block (outdent followed by a close curly bracket on the following line) prints a string on its own line and begins a new block (open curly bracket followed by an indent on the following line
      void forceNewLine()
      Print a linebreak unless we are at the start of a line.
      String getLinePrefix()  
      long getOffset()  
      boolean getPrintOffsets()  
      void indent()
      Increases the indent on the current line
      boolean isNoIndent()  
      boolean isNoNl()  
      boolean isoNlCr()  
      boolean isRemoveNl()  
      void openBlock()
      prints an open curly bracket and indents the following line
      void openBlock​(String s)
      Prints a string, an open curly bracket on its own line and indents the following line
      void outdent()
      Decreases the indent on the current line
      void print​(boolean b)
      print a boolean with no indent
      void print​(char c)
      print a character with no indent
      void print​(char[] s)
      print a character array with no indent
      void print​(double d)
      print a double with no indent
      void print​(float f)
      print a floating point number with no indent
      void print​(int i)
      print an integer with no indent
      void print​(int tempIndent, boolean b)
      Indent the current line and print a boolean on the same line
      void print​(int tempIndent, char c)
      Indent the current line and print a character on the same line
      void print​(int tempIndent, char[] s)
      Indent the current line and print a character array on the same line
      void print​(int tempIndent, double d)
      Indent the current line and print a double on the same line
      void print​(int tempIndent, float f)
      Indent the current line and print a floating point number on the same line
      void print​(int tempIndent, int i)
      Indent the current line and print an integer on the same line
      void print​(int tempIndent, long l)
      Indent the current line and print a long integer on the same line
      void print​(int tempIndent, Object obj)
      Indent the current line and print an object on the same line
      void print​(int tempIndent, String s)
      Indent the current line and print a string on the same line
      void print​(int indent, String pattern, Object... arguments)
      Calls string.format, indents and prints
      void print​(long l)
      print a long integer with no indent
      void print​(Object obj)
      print an object with no indent
      void print​(String s)
      print a string with no indent
      void print​(String pattern, Object... arguments)
      Convenience method for calling string.format and printing
      void printAlignedBlock()
      Prints the alignedblock without any separators or terminators
      void printlines​(String... strings)
      Print multiple strings, each with a line break.
      void println()
      Prints a linebreak
      void println​(boolean x)
      print a boolean with no indent with a line break
      void println​(char x)
      print a character with no indent with a line break
      void println​(char[] x)
      print a character array with no indent with a line break
      void println​(double x)
      print a double with no indent with a line break
      void println​(float x)
      print a floating point number with no indent with a line break
      void println​(int x)
      print an integer with no indent with a line break
      void println​(int tempIndent, boolean x)
      Indent the current line and print a boolean on the same line, then print a line break
      void println​(int tempIndent, char x)
      Indent the current line and print a character on the same line, then print a line break
      void println​(int tempIndent, char[] x)
      Indent the current line and print a character array on the same line, then print a line break
      void println​(int tempIndent, double x)
      Indent the current line and print a double on the same line, then print a line break
      void println​(int tempIndent, float x)
      Indent the current line and print a floating point number on the same line, then print a line break
      void println​(int tempIndent, int x)
      Indent the current line and print an integer on the same line, then print a line break
      void println​(int tempIndent, long x)
      Indent the current line and print a long integer on the same line, then print a line break
      void println​(int tempIndent, Object x)
      Indent the current line and print an object on the same line, then print a line break
      void println​(int tempIndent, String x)
      Indent the current line and print a string on the same line, then print a line break
      void println​(int indent, String pattern, Object... arguments)
      Calls string.format, indents and prints with line break
      void println​(long x)
      print a long integer with no indent with a line break
      void println​(Object x)
      print an object with no indent with a line break
      void println​(String x)
      print a string with no indent with a line break
      void println​(String pattern, Object... arguments)
      Convenience method for calling string.format and printing with line breaks
      void println​(Collection<String> str)
      Prints all strings in a collection on individual lines
      void setLinePrefix​(String linePrefix)  
      void setNoIndent​(boolean noIndent)  
      void setNoNl​(boolean noNl)  
      void setoNlCr​(boolean oNlCr)  
      void setPrintOffsets​(boolean printOffsets)  
      void setRemoveNl​(boolean removeNl)  
    • Constructor Detail

      • IndentedPrintStream

        public IndentedPrintStream​(OutputStream outputStream)
    • Method Detail

      • setPrintOffsets

        public void setPrintOffsets​(boolean printOffsets)
      • getPrintOffsets

        public boolean getPrintOffsets()
      • setLinePrefix

        public void setLinePrefix​(String linePrefix)
      • getLinePrefix

        public String getLinePrefix()
      • align

        public void align​(Object... s)
        Takes an array of strings to be aligned in separate columns, and adds them to the alignedblock
      • printAlignedBlock

        public void printAlignedBlock()
        Prints the alignedblock without any separators or terminators
      • openBlock

        public void openBlock()
        prints an open curly bracket and indents the following line
      • closeBlock

        public void closeBlock()
        Outdents the line and prints a close curly bracket on the following line
      • openBlock

        public void openBlock​(String s)
        Prints a string, an open curly bracket on its own line and indents the following line
        Parameters:
        s - preceding string
      • closeBlock

        public void closeBlock​(String s)
        Outdents the current line and prints a close curly bracket on the next line, followed by a string
        Parameters:
        s - succeeding string
      • continueBlock

        public void continueBlock​(String s)
        Ends one block (outdent followed by a close curly bracket on the following line) prints a string on its own line and begins a new block (open curly bracket followed by an indent on the following line
        Parameters:
        s - intermediate string
      • indent

        public void indent()
        Increases the indent on the current line
      • outdent

        public void outdent()
        Decreases the indent on the current line
      • print

        public void print​(int tempIndent,
                          boolean b)
        Indent the current line and print a boolean on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        b - boolean to be printed
      • print

        public void print​(int tempIndent,
                          char c)
        Indent the current line and print a character on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        c - character to be printed
      • print

        public void print​(int tempIndent,
                          char[] s)
        Indent the current line and print a character array on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        s - character array to be printed
      • print

        public void print​(int tempIndent,
                          double d)
        Indent the current line and print a double on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        d - double to be printed
      • print

        public void print​(int tempIndent,
                          float f)
        Indent the current line and print a floating point number on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        f - floating point number to be printed
      • print

        public void print​(int tempIndent,
                          int i)
        Indent the current line and print an integer on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        i - integer to be printed
      • print

        public void print​(int tempIndent,
                          Object obj)
        Indent the current line and print an object on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        obj - object to be printed
      • print

        public void print​(int tempIndent,
                          String s)
        Indent the current line and print a string on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        s - string to be printed
      • print

        public void print​(int tempIndent,
                          long l)
        Indent the current line and print a long integer on the same line
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        l - long integer to be printed
      • println

        public void println()
        Prints a linebreak
        Overrides:
        println in class PrintStream
      • forceNewLine

        public void forceNewLine()
        Print a linebreak unless we are at the start of a line.
      • println

        public void println​(int tempIndent,
                            boolean x)
        Indent the current line and print a boolean on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - boolean to be printed
      • println

        public void println​(int tempIndent,
                            char x)
        Indent the current line and print a character on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - character to be printed
      • println

        public void println​(int tempIndent,
                            char[] x)
        Indent the current line and print a character array on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - character array to be printed
      • println

        public void println​(int tempIndent,
                            double x)
        Indent the current line and print a double on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - double to be printed
      • println

        public void println​(int tempIndent,
                            float x)
        Indent the current line and print a floating point number on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - floating point number to be printed
      • println

        public void println​(int tempIndent,
                            int x)
        Indent the current line and print an integer on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - integer to be printed
      • println

        public void println​(int tempIndent,
                            Object x)
        Indent the current line and print an object on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - object to be printed
      • println

        public void println​(int tempIndent,
                            String x)
        Indent the current line and print a string on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - string to be printed
      • println

        public void println​(int tempIndent,
                            long x)
        Indent the current line and print a long integer on the same line, then print a line break
        Parameters:
        tempIndent - magnitude of the indent (number of tab spaces)
        x - long integer to be printed
      • print

        public void print​(boolean b)
        print a boolean with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        b - boolean to print
      • print

        public void print​(char c)
        print a character with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        c - character to print
      • print

        public void print​(char[] s)
        print a character array with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        s - character array to print
      • print

        public void print​(double d)
        print a double with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        d - double to print
      • print

        public void print​(float f)
        print a floating point number with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        f - floating point number to print
      • print

        public void print​(int i)
        print an integer with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        i - integer to print
      • print

        public void print​(Object obj)
        print an object with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        obj - object to print
      • print

        public void print​(String s)
        print a string with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        s - string to print
      • print

        public void print​(long l)
        print a long integer with no indent
        Overrides:
        print in class PrintStream
        Parameters:
        l - long integer to print
      • println

        public void println​(boolean x)
        print a boolean with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - boolean to print
      • println

        public void println​(char x)
        print a character with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - character to print
      • println

        public void println​(char[] x)
        print a character array with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - character array to print
      • println

        public void println​(double x)
        print a double with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - double to print
      • println

        public void println​(float x)
        print a floating point number with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - floating point number to print
      • println

        public void println​(int x)
        print an integer with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - integer to print
      • println

        public void println​(Object x)
        print an object with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - object to print
      • println

        public void println​(String x)
        print a string with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - string to print
      • printlines

        public void printlines​(String... strings)
        Print multiple strings, each with a line break.
        Parameters:
        strings - multiple strings to print.
      • println

        public void println​(long x)
        print a long integer with no indent with a line break
        Overrides:
        println in class PrintStream
        Parameters:
        x - long integer to print
      • println

        public void println​(Collection<String> str)
        Prints all strings in a collection on individual lines
        Parameters:
        str - collection of strings
      • print

        public void print​(String pattern,
                          Object... arguments)
        Convenience method for calling string.format and printing
      • println

        public void println​(String pattern,
                            Object... arguments)
        Convenience method for calling string.format and printing with line breaks
      • print

        public void print​(int indent,
                          String pattern,
                          Object... arguments)
        Calls string.format, indents and prints
      • println

        public void println​(int indent,
                            String pattern,
                            Object... arguments)
        Calls string.format, indents and prints with line break
      • getOffset

        public long getOffset()
      • isoNlCr

        public boolean isoNlCr()
      • setoNlCr

        public void setoNlCr​(boolean oNlCr)
      • isNoIndent

        public boolean isNoIndent()
      • setNoIndent

        public void setNoIndent​(boolean noIndent)
      • isNoNl

        public boolean isNoNl()
      • setNoNl

        public void setNoNl​(boolean noNl)
      • isRemoveNl

        public boolean isRemoveNl()
      • setRemoveNl

        public void setRemoveNl​(boolean removeNl)