StringBuffer (Java Platform SE 7 ) (original) (raw)

Modifier and Type

Method and Description

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28boolean%29)**(boolean b)

Appends the string representation of the boolean argument to the sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28char%29)**(char c)

Appends the string representation of the char argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28char[]%29)**(char[] str)

Appends the string representation of the char array argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28char[],%20int,%20int%29)**(char[] str, int offset, int len)

Appends the string representation of a subarray of thechar array argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28java.lang.CharSequence%29)**([CharSequence](../../java/lang/CharSequence.html "interface in java.lang") s)

Appends the specified CharSequence to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28java.lang.CharSequence,%20int,%20int%29)**([CharSequence](../../java/lang/CharSequence.html "interface in java.lang") s, int start, int end)

Appends a subsequence of the specified CharSequence to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28double%29)**(double d)

Appends the string representation of the double argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28float%29)**(float f)

Appends the string representation of the float argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28int%29)**(int i)

Appends the string representation of the int argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28long%29)**(long lng)

Appends the string representation of the long argument to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") obj)

Appends the string representation of the Object argument.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28java.lang.String%29)**([String](../../java/lang/String.html "class in java.lang") str)

Appends the specified string to this character sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[append](../../java/lang/StringBuffer.html#append%28java.lang.StringBuffer%29)**([StringBuffer](../../java/lang/StringBuffer.html "class in java.lang") sb)

Appends the specified

StringBuffer

to this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[appendCodePoint](../../java/lang/StringBuffer.html#appendCodePoint%28int%29)**(int codePoint)

Appends the string representation of the codePoint argument to this sequence.

int

**[capacity](../../java/lang/StringBuffer.html#capacity%28%29)**()

Returns the current capacity.

char

**[charAt](../../java/lang/StringBuffer.html#charAt%28int%29)**(int index)

Returns the char value in this sequence at the specified index.

int

**[codePointAt](../../java/lang/StringBuffer.html#codePointAt%28int%29)**(int index)

Returns the character (Unicode code point) at the specified index.

int

**[codePointBefore](../../java/lang/StringBuffer.html#codePointBefore%28int%29)**(int index)

Returns the character (Unicode code point) before the specified index.

int

**[codePointCount](../../java/lang/StringBuffer.html#codePointCount%28int,%20int%29)**(int beginIndex, int endIndex)

Returns the number of Unicode code points in the specified text range of this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[delete](../../java/lang/StringBuffer.html#delete%28int,%20int%29)**(int start, int end)

Removes the characters in a substring of this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[deleteCharAt](../../java/lang/StringBuffer.html#deleteCharAt%28int%29)**(int index)

Removes the char at the specified position in this sequence.

void

**[ensureCapacity](../../java/lang/StringBuffer.html#ensureCapacity%28int%29)**(int minimumCapacity)

Ensures that the capacity is at least equal to the specified minimum.

void

**[getChars](../../java/lang/StringBuffer.html#getChars%28int,%20int,%20char[],%20int%29)**(int srcBegin, int srcEnd, char[] dst, int dstBegin)

Characters are copied from this sequence into the destination character array dst.

int

**[indexOf](../../java/lang/StringBuffer.html#indexOf%28java.lang.String%29)**([String](../../java/lang/String.html "class in java.lang") str)

Returns the index within this string of the first occurrence of the specified substring.

int

**[indexOf](../../java/lang/StringBuffer.html#indexOf%28java.lang.String,%20int%29)**([String](../../java/lang/String.html "class in java.lang") str, int fromIndex)

Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20boolean%29)**(int offset, boolean b)

Inserts the string representation of the boolean argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20char%29)**(int offset, char c)

Inserts the string representation of the char argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20char[]%29)**(int offset, char[] str)

Inserts the string representation of the char array argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20char[],%20int,%20int%29)**(int index, char[] str, int offset, int len)

Inserts the string representation of a subarray of the str array argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20java.lang.CharSequence%29)**(int dstOffset,[CharSequence](../../java/lang/CharSequence.html "interface in java.lang") s)

Inserts the specified CharSequence into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20java.lang.CharSequence,%20int,%20int%29)**(int dstOffset,[CharSequence](../../java/lang/CharSequence.html "interface in java.lang") s, int start, int end)

Inserts a subsequence of the specified CharSequence into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20double%29)**(int offset, double d)

Inserts the string representation of the double argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20float%29)**(int offset, float f)

Inserts the string representation of the float argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20int%29)**(int offset, int i)

Inserts the string representation of the second int argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20long%29)**(int offset, long l)

Inserts the string representation of the long argument into this sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20java.lang.Object%29)**(int offset,[Object](../../java/lang/Object.html "class in java.lang") obj)

Inserts the string representation of the Object argument into this character sequence.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[insert](../../java/lang/StringBuffer.html#insert%28int,%20java.lang.String%29)**(int offset,[String](../../java/lang/String.html "class in java.lang") str)

Inserts the string into this character sequence.

int

**[lastIndexOf](../../java/lang/StringBuffer.html#lastIndexOf%28java.lang.String%29)**([String](../../java/lang/String.html "class in java.lang") str)

Returns the index within this string of the rightmost occurrence of the specified substring.

int

**[lastIndexOf](../../java/lang/StringBuffer.html#lastIndexOf%28java.lang.String,%20int%29)**([String](../../java/lang/String.html "class in java.lang") str, int fromIndex)

Returns the index within this string of the last occurrence of the specified substring.

int

**[length](../../java/lang/StringBuffer.html#length%28%29)**()

Returns the length (character count).

int

**[offsetByCodePoints](../../java/lang/StringBuffer.html#offsetByCodePoints%28int,%20int%29)**(int index, int codePointOffset)

Returns the index within this sequence that is offset from the given index by codePointOffset code points.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[replace](../../java/lang/StringBuffer.html#replace%28int,%20int,%20java.lang.String%29)**(int start, int end,[String](../../java/lang/String.html "class in java.lang") str)

Replaces the characters in a substring of this sequence with characters in the specified String.

[StringBuffer](../../java/lang/StringBuffer.html "class in java.lang")

**[reverse](../../java/lang/StringBuffer.html#reverse%28%29)**()

Causes this character sequence to be replaced by the reverse of the sequence.

void

**[setCharAt](../../java/lang/StringBuffer.html#setCharAt%28int,%20char%29)**(int index, char ch)

The character at the specified index is set to ch.

void

**[setLength](../../java/lang/StringBuffer.html#setLength%28int%29)**(int newLength)

Sets the length of the character sequence.

[CharSequence](../../java/lang/CharSequence.html "interface in java.lang")

**[subSequence](../../java/lang/StringBuffer.html#subSequence%28int,%20int%29)**(int start, int end)

Returns a new character sequence that is a subsequence of this sequence.

[String](../../java/lang/String.html "class in java.lang")

**[substring](../../java/lang/StringBuffer.html#substring%28int%29)**(int start)

Returns a new String that contains a subsequence of characters currently contained in this character sequence.

[String](../../java/lang/String.html "class in java.lang")

**[substring](../../java/lang/StringBuffer.html#substring%28int,%20int%29)**(int start, int end)

Returns a new String that contains a subsequence of characters currently contained in this sequence.

[String](../../java/lang/String.html "class in java.lang")

**[toString](../../java/lang/StringBuffer.html#toString%28%29)**()

Returns a string representing the data in this sequence.

void

**[trimToSize](../../java/lang/StringBuffer.html#trimToSize%28%29)**()

Attempts to reduce storage used for the character sequence.