Package org.jf.util

Class IndentingWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class IndentingWriter
    extends java.io.Writer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected char[] buffer  
      protected int indentLevel  
      protected java.io.Writer writer  
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      IndentingWriter​(java.io.Writer writer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Writer append​(char c)  
      java.io.Writer append​(java.lang.CharSequence charSequence)  
      java.io.Writer append​(java.lang.CharSequence charSequence, int start, int len)  
      void close()  
      void deindent​(int indentAmount)  
      void flush()  
      void indent​(int indentAmount)  
      void write​(char[] chars)  
      void write​(char[] chars, int start, int len)  
      void write​(int chr)  
      void write​(java.lang.String s)  
      void write​(java.lang.String str, int start, int len)  
      protected void writeIndent()  
      • 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
    • Field Detail

      • writer

        protected final java.io.Writer writer
      • buffer

        protected final char[] buffer
      • indentLevel

        protected int indentLevel
    • Constructor Detail

      • IndentingWriter

        public IndentingWriter​(java.io.Writer writer)
    • Method Detail

      • writeIndent

        protected void writeIndent()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(int chr)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(char[] chars)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(char[] chars,
                          int start,
                          int len)
                   throws java.io.IOException
        Specified by:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String s)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String str,
                          int start,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • append

        public java.io.Writer append​(java.lang.CharSequence charSequence)
                              throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
        Throws:
        java.io.IOException
      • append

        public java.io.Writer append​(java.lang.CharSequence charSequence,
                                     int start,
                                     int len)
                              throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
        Throws:
        java.io.IOException
      • append

        public java.io.Writer append​(char c)
                              throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in class java.io.Writer
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Writer
        Throws:
        java.io.IOException
      • indent

        public void indent​(int indentAmount)
      • deindent

        public void deindent​(int indentAmount)