public class FastStringBuffer extends Object
| Constructor and Description |
|---|
FastStringBuffer(int capacity)
Deprecated.
Constructs a new
FastStringBuffer object with the specified
initial capacity. |
FastStringBuffer(int capacity,
String s)
Deprecated.
Constructs a new
FastStringBuffer object with the specified
initial capacity and content. |
FastStringBuffer(String s)
Deprecated.
Constructs a new
FastStringBuffer object with the specified
initial content. |
| Modifier and Type | Method and Description |
|---|---|
void |
append(boolean b)
Deprecated.
Appends the specified boolean.
|
void |
append(byte n)
Deprecated.
Appends the string representation of the specified
byte. |
void |
append(char c)
Deprecated.
Appends the specified character.
|
void |
append(char[] cbuf)
Deprecated.
Appends all characters in the specified character buffer.
|
void |
append(char[] cbuf,
int off,
int len)
Deprecated.
Appends characters from the specified character buffer.
|
void |
append(double n)
Deprecated.
Appends the string representation of the specified
double. |
void |
append(float n)
Deprecated.
Appends the string representation of the specified
float. |
void |
append(int n)
Deprecated.
Appends the string representation of the specified
int. |
void |
append(long n)
Deprecated.
Appends the string representation of the specified
long. |
void |
append(short n)
Deprecated.
Appends the string representation of the specified
short. |
void |
append(String str)
Deprecated.
Appends all characters in the specified character string.
|
void |
clear()
Deprecated.
Clears this string buffer.
|
void |
crop(int newLength)
Deprecated.
Reduces the length of this string buffer.
|
int |
getCapacity()
Deprecated.
Gets the capacity of this string buffer.
|
int |
getLength()
Deprecated.
Gets the length of this string buffer.
|
char |
setChar(int index,
char newChar)
Deprecated.
Sets the character at the specified index.
|
String |
toString()
Deprecated.
Converts the contents of this buffer to a
String object. |
public FastStringBuffer(int capacity)
throws IllegalArgumentException
FastStringBuffer object with the specified
initial capacity.capacity - the initial capacity, must be >= 0.IllegalArgumentException - if capacity < 0.public FastStringBuffer(String s) throws IllegalArgumentException
FastStringBuffer object with the specified
initial content. The capacity will be equal to the length of the
specified string.s - the initial content, cannot be null.IllegalArgumentException - if s == null.public FastStringBuffer(int capacity,
String s)
throws IllegalArgumentException
FastStringBuffer object with the specified
initial capacity and content.capacity - the initial capacity, must be
>= s.String.length().s - the initial content, cannot be null.IllegalArgumentException - if s == null
|| capacity < s.String.length().public void append(boolean b)
b - the boolean to append, if it is true then the string
"true" will be appended, otherwise the string
"false" will be appended..public void append(char c)
c - the character to append.public void append(char[] cbuf)
throws IllegalArgumentException
cbuf - the character array to copy characters from, not null.IllegalArgumentException - if cbuf == null.public void append(char[] cbuf,
int off,
int len)
throws IllegalArgumentException
cbuf - the character array to copy characters from, not null.off - the offset in cbuf, must be >= 0 and <
cbuf.length.len - the number of characters to copy, must be >= 0 and (off +
len) must be <= cbuf.length.IllegalArgumentException - if cbuf == null
|| off < 0
|| off > cbuf.length
|| len < 0
|| (off + len > cbuf.length).public void append(String str) throws IllegalArgumentException
str - the character string to copy characters from, not null.IllegalArgumentException - if str == null.public void append(byte n)
byte.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public void append(short n)
short.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public void append(int n)
int.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public void append(long n)
long.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public void append(float n)
float.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public void append(double n)
double.
If necessary, the capacity of this string buffer will be increased.n - the number of which the string representation should be added to this
buffer.public int getLength()
getCapacity().public int getCapacity()
getLength().public char setChar(int index,
char newChar)
throws IndexOutOfBoundsException
index - the index at which to set the character, must be <
getLength().newChar - the new character value.IndexOutOfBoundsException - if index < 0 || index >= getLength().public void crop(int newLength)
throws IllegalArgumentException
newLength - the new length, must be less than or equal to the current length (see
getLength()).IllegalArgumentException - if newLength < 0
|| newLength > getLength().public void clear()
See http://www.xins.org/.