|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jasper.runtime.CharBuffer
public class CharBuffer
An efficient character buffer class. This class is not thread-safe, so its clients will have to take care of any necessary thread issues.
Constructor Summary | |
---|---|
CharBuffer(int initialCapacity)
Create a new character buffer, specifying its initial capacity. |
|
CharBuffer(int initialCapacity,
int minimumGrowth)
Create a new character buffer, specifying its initial capacity and minimum growth. |
Method Summary | |
---|---|
void |
buffer(char character)
Add the supplied character to this buffer, growing the buffer if necessary. |
void |
buffer(char[] characters,
int start,
int length)
Add a section of the supplied character array to this buffer, growing the buffer if necessary. |
void |
buffer(java.lang.String text,
int start,
int length)
Add a substring of the supplied string to this buffer, growing the buffer if necessary. |
void |
clear()
Clear this buffer. |
int |
getCapacity()
Find the current capacity of this buffer. |
int |
size()
Obtain the current size of this buffer. |
char[] |
toArray()
Render this buffer as a character array. |
java.lang.String |
toString()
Render this buffer as a String. |
void |
writeOut(java.io.Writer writer)
Write the content of this buffer out to the supplied Writer object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CharBuffer(int initialCapacity)
initialCapacity
- public CharBuffer(int initialCapacity, int minimumGrowth)
initialCapacity
- The number of characters initially provisioned for.minimumGrowth
- The smallest number of characters by which the buffer will grow.
If zero is specified then the value of the initial capacity will be used.Method Detail |
---|
public void buffer(char character)
character
- public void buffer(java.lang.String text, int start, int length) throws java.lang.IllegalArgumentException
text
- The original String that is to be added to the buffer.start
- The index of the starting character to add to the buffer (zero-based).length
- The number of characters to add to the buffer.
java.lang.IllegalArgumentException
- If text is null, start points beyond end of text, or start + length
goes beyond end of text.public void buffer(char[] characters, int start, int length) throws java.lang.IllegalArgumentException
characters
- The character array that is to be added to the buffer.start
- The index of the starting character to add to the buffer (zero-based).length
- The number of characters to add to the buffer.
java.lang.IllegalArgumentException
- If array is null, start points beyond end of array, or start + length
goes beyond end of array.public char[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object
public int getCapacity()
public int size()
toArray()
or the length of String returned by toString()
.public void clear()
size()
will return zero.
public void writeOut(java.io.Writer writer) throws java.io.IOException, java.lang.IllegalArgumentException
writer
- The writer in to which the buffer should be written.
java.io.IOException
- If any error occurs while writing the buffer into the stream.
java.lang.IllegalArgumentException
- If 'writer' is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |