Package com.ctc.wstx.util
Class TextBuilder
java.lang.Object
com.ctc.wstx.util.TextBuilder
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private char[]
private int
private static final int
private String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(char c) void
append
(char[] src, int start, int len) char[]
bufferFull
(int needSpaceFor) char[]
Method that gives access to underlying character bufferint
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.private void
resize
(int needSpaceFor) void
setBufferSize
(int newSize) toString()
-
Field Details
-
MIN_LEN
private static final int MIN_LEN- See Also:
-
MAX_LEN
private static final int MAX_LEN- See Also:
-
mBuffer
private char[] mBuffer -
mBufferLen
private int mBufferLen -
mResultString
-
-
Constructor Details
-
TextBuilder
public TextBuilder(int initialSize)
-
-
Method Details
-
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
-
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) -
toString
-
resize
private void resize(int needSpaceFor)
-