Main Page | Class Hierarchy | Class List | Class Members | Related Pages

org::jdom::input::TextBuffer Class Reference

List of all members.

Public Member Functions

 TextBuffer ()
void append (char[] source, int start, int count)
int size ()
void clear ()
String toString ()

Detailed Description

TextBuffer is similar to StringBuffer, but optimized for XML parsing, where the common case is that you get only one chunk of characters per text section. TextBuffer stores the first chunk of characters in a String, which can just be returned directly if no second chunk is received. Subsequent chunks are stored in a supplemental char array (like StringBuffer uses). In this case, the returned text will be the first String chunk, concatenated with the subsequent chunks stored in the char array. This provides optimal performance in the common case, while still providing very good performance in the uncommon case. Furthermore, avoiding StringBuffer means that no extra unused char array space will be kept around after parsing is through.

Author:
Bradley S. Huffman

Alex Rosen

Version:
Revision
1.5
,
Date
2003/01/23 02:23:31


Constructor & Destructor Documentation

org::jdom::input::TextBuffer::TextBuffer  )  [inline]
 

Constructor


Member Function Documentation

void org::jdom::input::TextBuffer::append char[]  source,
int  start,
int  count
[inline]
 

Append the specified text to the text value of this buffer.

void org::jdom::input::TextBuffer::clear  )  [inline]
 

Clears the text value and prepares the TextBuffer for reuse.

int org::jdom::input::TextBuffer::size  )  [inline]
 

Returns the size of the text value.

String org::jdom::input::TextBuffer::toString  )  [inline]
 

Returns the text value stored in the buffer.


The documentation for this class was generated from the following file:
Generated on Wed Jul 7 01:03:20 2004 for JDOM by doxygen 1.3.7