Top Description Fields Constructors Methods
com.ctc.wstx.util

public final Class TextBuilder

extends Object
Class Inheritance

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

Modifier and TypeField and Description
private static final int
private char[]
private int
private static final int
private String

Constructor Summary

AccessConstructor and Description
public
TextBuilder(int initialSize)

Method Summary

Modifier and TypeMethod and Description
public void
append(char c)

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

public char[]
bufferFull(int needSpaceFor)

public String
public char[]
getCharBuffer()

Method that gives access to underlying character buffer

public int
public boolean
public 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)

public void
setBufferSize(int newSize)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

MAX_LENback to summary
private static final int MAX_LEN
mBufferback to summary
private char[] mBuffer
mBufferLenback to summary
private int mBufferLen
MIN_LENback to summary
private static final int MIN_LEN
mResultStringback to summary
private String mResultString

Constructor Detail

TextBuilderback to summary
public TextBuilder(int initialSize)

Method Detail

appendback to summary
public void append(char c)
appendback to summary
public void append(char[] src, int start, int len)
bufferFullback to summary
public char[] bufferFull(int needSpaceFor)
getAllValuesback to summary
public String getAllValues()
getCharBufferback to summary
public char[] getCharBuffer()

Method that gives access to underlying character buffer

getCharSizeback to summary
public int getCharSize()
isEmptyback to summary
public boolean isEmpty()
resetback to summary
public void reset()

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

resizeback to summary
private void resize(int needSpaceFor)
setBufferSizeback to summary
public void setBufferSize(int newSize)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override