|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.utils.FastStringBuffer
Bare-bones, unsafe, fast string buffer. No thread-safety, no parameter range checking, exposed fields. Note that in typical applications, thread-safety of a StringBuffer is a somewhat dubious concept in any case.
Field Summary | |
int |
m_blocksize
Field m_blocksize establishes the allocation granularity -- the initial size of m_map[] and the minimum increment by which it grows when necessary. |
int |
m_firstFree
Field m_firstFree is an index into m_map[], pointing to the first character in the array which is not part of the FastStringBuffer's current content. |
char[] |
m_map
Field m_map[] is a character array holding the string buffer's contents. |
int |
m_mapSize
Field m_mapSize is a cached copy of m_map.length -- or, transiently, the new length that m_map will grow to. |
Constructor Summary | |
FastStringBuffer()
Construct a IntVector, using the default block size. |
|
FastStringBuffer(int blocksize)
Construct a IntVector, using the given block size. |
Method Summary | |
void |
append(char value)
Append a single character onto the FastStringBuffer, growing the storage if necessary. |
void |
append(char[] chars,
int start,
int length)
Append part of the contents of a Character Array onto the FastStringBuffer, growing the storage if necessary. |
void |
append(FastStringBuffer value)
Append the contents of another FastStringBuffer onto this FastStringBuffer, growing the storage if necessary. |
void |
append(java.lang.String value)
Append the contents of a String onto the FastStringBuffer, growing the storage if necessary. |
void |
append(java.lang.StringBuffer value)
Append the contents of a StringBuffer onto the FastStringBuffer, growing the storage if necessary. |
int |
length()
Get the length of the list. |
void |
reset()
Discard the content of the FastStringBuffer. |
void |
setLength(int l)
Directly set how much of the FastStringBuffer's storage is to be considered part of its content. |
int |
size()
Get the length of the list. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public int m_blocksize
public char[] m_map
public int m_firstFree
public int m_mapSize
Constructor Detail |
public FastStringBuffer()
public FastStringBuffer(int blocksize)
blocksize
- Desired value for m_blocksize, establishes both
the initial storage allocation and the minimum growth increment.Method Detail |
public final int size()
public final int length()
public final void reset()
public final void setLength(int l)
l
- New length. If l<0 or l>=m_mapSize, this operation will
not report an error but future operations will almost certainly fail.public final java.lang.String toString()
public final void append(char value)
NOTE THAT after calling append(), previously obtained references to m_map[] may no longer be valid.
value
- character to be appended.public final void append(java.lang.String value)
NOTE THAT after calling append(), previously obtained references to m_map[] may no longer be valid.
value
- String whose contents are to be appended.public final void append(java.lang.StringBuffer value)
NOTE THAT after calling append(), previously obtained references to m_map[] may no longer be valid.
value
- StringBuffer whose contents are to be appended.public final void append(char[] chars, int start, int length)
NOTE THAT after calling append(), previously obtained references to m_map[] may no longer be valid.
chars
- character array from which data is to be copiedstart
- offset in chars of first character to be copied,
zero-based.length
- number of characters to be copiedpublic final void append(FastStringBuffer value)
NOTE THAT after calling append(), previously obtained references to m_map[] may no longer be valid.
value
- FastStringBuffer whose contents are
to be appended.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |