|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.grammatica.parser.re.CharBuffer
A character buffer. This class provides an API identical to StringBuffer, with the exception that none of the methods in this class are synchronized.
Constructor Summary | |
CharBuffer()
Creates a new character buffer. |
|
CharBuffer(int initialSize)
Creates a new character buffer with the specified initial size. |
|
CharBuffer(java.lang.String str)
Creates a new character buffer from the specified string. |
|
CharBuffer(java.lang.StringBuffer str)
Creates a new character buffer from the specified string buffer. |
Method Summary | |
CharBuffer |
append(boolean b)
Appends the string representation of a boolean value to the end of the buffer. |
CharBuffer |
append(char c)
Appends a character to the end of the buffer. |
CharBuffer |
append(char[] str)
Appends a character array to the end of the buffer. |
CharBuffer |
append(char[] str,
int offset,
int length)
Appends a character array to the end of the buffer. |
CharBuffer |
append(double d)
Appends the string representation of a double value to the end of the buffer. |
CharBuffer |
append(float f)
Appends the string representation of a float value to the end of the buffer. |
CharBuffer |
append(int i)
Appends the string representation of an int value to the end of the buffer. |
CharBuffer |
append(long l)
Appends the string representation of a long value to the end of the buffer. |
CharBuffer |
append(java.lang.Object obj)
Appends the string representation of an object to the end of the buffer. |
CharBuffer |
append(java.lang.String str)
Appends a string to the end of the buffer. |
CharBuffer |
append(java.lang.StringBuffer str)
Appends a string buffer to the end of the buffer. |
char |
charAt(int index)
Returns a character in the buffer. |
CharBuffer |
delete(int start,
int end)
Removes characters from this buffer. |
void |
ensureCapacity(int size)
Ensures that this buffer has at least the specified capacity. |
int |
length()
Returns the number of characters in the buffer. |
java.lang.String |
substring(int start)
Returns a string containing a sequence of characters from this buffer. |
java.lang.String |
substring(int start,
int end)
Returns a string containing a sequence of characters from this buffer. |
java.lang.String |
toString()
Returns a string containing all character in this buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CharBuffer()
public CharBuffer(int initialSize)
initialSize
- the initial size of the bufferpublic CharBuffer(java.lang.String str)
str
- the string to copypublic CharBuffer(java.lang.StringBuffer str)
str
- the string buffer to copyMethod Detail |
public CharBuffer append(boolean b)
b
- the boolean value to append
public CharBuffer append(char c)
c
- the character to append
public CharBuffer append(char[] str)
str
- the characters to append
public CharBuffer append(char[] str, int offset, int length)
str
- the character array to appendoffset
- the starting position in the arraylength
- the number of characters to copy
public CharBuffer append(double d)
d
- the double value to append
public CharBuffer append(float f)
f
- the float value to append
public CharBuffer append(int i)
i
- the int value to append
public CharBuffer append(long l)
l
- the long value to append
public CharBuffer append(java.lang.Object obj)
obj
- the object to append
public CharBuffer append(java.lang.String str)
str
- the string to append
public CharBuffer append(java.lang.StringBuffer str)
str
- the string buffer to append
public char charAt(int index) throws java.lang.StringIndexOutOfBoundsException
index
- the character position, 0 <= index < length
java.lang.StringIndexOutOfBoundsException
- if the character
position was negative or higher or equal to the
buffer lengthpublic CharBuffer delete(int start, int end) throws java.lang.StringIndexOutOfBoundsException
start
- the starting position (inclusive)end
- the ending position (exclusive)
java.lang.StringIndexOutOfBoundsException
- if the start or end
indexes were out of boundspublic void ensureCapacity(int size)
size
- the minimum buffer sizepublic int length()
public java.lang.String substring(int start) throws java.lang.StringIndexOutOfBoundsException
start
- the start index, inclusive
java.lang.StringIndexOutOfBoundsException
- if the start index was
negative, or higher than the length of the stringpublic java.lang.String substring(int start, int end) throws java.lang.StringIndexOutOfBoundsException
start
- the start index, inclusiveend
- end end index, exclusive
java.lang.StringIndexOutOfBoundsException
- if the start index was
negative, or higher than the length of the stringpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |