Class TextBuilder


  • public final class TextBuilder
    extends Object
    Class similar to StringBuilder, except that it can be used to construct multiple Strings, that will share same underlying character buffer. This is generally useful for closely related value Strings, such as attribute values of a single XML start element.
    • Constructor Detail

      • TextBuilder

        public TextBuilder​(int initialSize)
    • Method Detail

      • reset

        public void reset()
        Method called before starting to (re)use the buffer, will discard any existing content, and start collecting new set of values.
      • isEmpty

        public boolean isEmpty()
      • getAllValues

        public String getAllValues()
      • getCharBuffer

        public char[] getCharBuffer()
        Method that gives access to underlying character buffer
      • getCharSize

        public int getCharSize()
      • append

        public void append​(char c)
      • append

        public void append​(char[] src,
                           int start,
                           int len)
      • setBufferSize

        public void setBufferSize​(int newSize)
      • bufferFull

        public char[] bufferFull​(int needSpaceFor)