public class CharBuffer
extends java.lang.Object
Constructor and Description |
---|
CharBuffer()
Deprecated.
Creates a new character buffer.
|
CharBuffer(int initialSize)
Deprecated.
Creates a new character buffer with the specified initial size.
|
CharBuffer(java.lang.String str)
Deprecated.
Creates a new character buffer from the specified string.
|
CharBuffer(java.lang.StringBuffer str)
Deprecated.
Creates a new character buffer from the specified string
buffer.
|
Modifier and Type | Method and Description |
---|---|
CharBuffer |
append(boolean b)
Deprecated.
Appends the string representation of a boolean value to the
end of the buffer.
|
CharBuffer |
append(char c)
Deprecated.
Appends a character to the end of the buffer.
|
CharBuffer |
append(char[] str)
Deprecated.
Appends a character array to the end of the buffer.
|
CharBuffer |
append(char[] str,
int offset,
int length)
Deprecated.
Appends a character array to the end of the buffer.
|
CharBuffer |
append(double d)
Deprecated.
Appends the string representation of a double value to the end
of the buffer.
|
CharBuffer |
append(float f)
Deprecated.
Appends the string representation of a float value to the end
of the buffer.
|
CharBuffer |
append(int i)
Deprecated.
Appends the string representation of an int value to the end of
the buffer.
|
CharBuffer |
append(long l)
Deprecated.
Appends the string representation of a long value to the end of
the buffer.
|
CharBuffer |
append(java.lang.Object obj)
Deprecated.
Appends the string representation of an object to the end of
the buffer.
|
CharBuffer |
append(java.lang.String str)
Deprecated.
Appends a string to the end of the buffer.
|
CharBuffer |
append(java.lang.StringBuffer str)
Deprecated.
Appends a string buffer to the end of the buffer.
|
char |
charAt(int index)
Deprecated.
Returns a character in the buffer.
|
CharBuffer |
delete(int start,
int end)
Deprecated.
Removes characters from this buffer.
|
void |
ensureCapacity(int size)
Deprecated.
Ensures that this buffer has at least the specified capacity.
|
int |
length()
Deprecated.
Returns the number of characters in the buffer.
|
java.lang.String |
substring(int start)
Deprecated.
Returns a string containing a sequence of characters from this
buffer.
|
java.lang.String |
substring(int start,
int end)
Deprecated.
Returns a string containing a sequence of characters from this
buffer.
|
java.lang.String |
toString()
Deprecated.
Returns a string containing all character in this buffer.
|
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 copypublic CharBuffer append(boolean b)
b
- the boolean value to appendpublic CharBuffer append(char c)
c
- the character to appendpublic CharBuffer append(char[] str)
str
- the characters to appendpublic 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 copypublic CharBuffer append(double d)
d
- the double value to appendpublic CharBuffer append(float f)
f
- the float value to appendpublic CharBuffer append(int i)
i
- the int value to appendpublic CharBuffer append(long l)
l
- the long value to appendpublic CharBuffer append(java.lang.Object obj)
obj
- the object to appendpublic CharBuffer append(java.lang.String str)
str
- the string to appendpublic CharBuffer append(java.lang.StringBuffer str)
str
- the string buffer to appendpublic char charAt(int index) throws java.lang.StringIndexOutOfBoundsException
index
- the character position, starting at 0java.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, inclusivejava.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, exclusivejava.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