public final class TextBuilder
extends java.lang.Object
StringBuffer
, 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 value Strings of a single XML start element.Constructor and Description |
---|
TextBuilder(int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
append(char c) |
void |
append(char[] src,
int start,
int len) |
char[] |
bufferFull(int needSpaceFor) |
char[] |
getCharBuffer()
Method that gives access to underlying character buffer
|
int |
getCharSize() |
java.lang.String |
getEntry(int index) |
int |
getOffset(int index) |
boolean |
isEmpty() |
void |
reset()
Method called before starting to (re)use the buffer, will discard
any existing content, and start collecting new set of values.
|
void |
setBufferSize(int newSize) |
int |
size() |
void |
startNewEntry() |
java.lang.String |
toString() |
public void reset()
public boolean isEmpty()
public int size()
public java.lang.String getEntry(int index)
public int getOffset(int index)
public char[] getCharBuffer()
public int getCharSize()
public void startNewEntry()
public void append(char c)
public void append(char[] src, int start, int len)
public void setBufferSize(int newSize)
public char[] bufferFull(int needSpaceFor)
public java.lang.String toString()
toString
in class java.lang.Object