Methods Summary |
---|
public java.lang.StringBuilder | append(double d)Appends the string representation of the specified {@code double} value.
The {@code double} value is converted to a string according to the rule
defined by {@link String#valueOf(double)}.
append0(Double.toString(d));
return this;
|
public java.lang.StringBuilder | append(java.lang.Object obj)Appends the string representation of the specified {@code Object}.
The {@code Object} value is converted to a string according to the rule
defined by {@link String#valueOf(Object)}.
if (obj == null) {
appendNull();
} else {
append0(obj.toString());
}
return this;
|
public java.lang.StringBuilder | append(java.lang.String str)Appends the contents of the specified string. If the string is {@code
null}, then the string {@code "null"} is appended.
append0(str);
return this;
|
public java.lang.StringBuilder | append(java.lang.StringBuffer sb)Appends the contents of the specified {@code StringBuffer}. If the
StringBuffer is {@code null}, then the string {@code "null"} is
appended.
if (sb == null) {
appendNull();
} else {
append0(sb.getValue(), 0, sb.length());
}
return this;
|
public java.lang.StringBuilder | append(char[] ch)Appends the string representation of the specified {@code char[]}.
The {@code char[]} is converted to a string according to the rule
defined by {@link String#valueOf(char[])}.
append0(ch);
return this;
|
public java.lang.StringBuilder | append(char[] str, int offset, int len)Appends the string representation of the specified subset of the {@code
char[]}. The {@code char[]} value is converted to a String according to
the rule defined by {@link String#valueOf(char[],int,int)}.
append0(str, offset, len);
return this;
|
public java.lang.StringBuilder | append(java.lang.CharSequence csq)Appends the string representation of the specified {@code CharSequence}.
If the {@code CharSequence} is {@code null}, then the string {@code
"null"} is appended.
if (csq == null) {
appendNull();
} else {
append0(csq.toString());
}
return this;
|
public java.lang.StringBuilder | append(java.lang.CharSequence csq, int start, int end)Appends the string representation of the specified subsequence of the
{@code CharSequence}. If the {@code CharSequence} is {@code null}, then
the string {@code "null"} is used to extract the subsequence from.
append0(csq, start, end);
return this;
|
public java.lang.StringBuilder | append(boolean b)Appends the string representation of the specified {@code boolean} value.
The {@code boolean} value is converted to a String according to the rule
defined by {@link String#valueOf(boolean)}.
append0(b ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
return this;
|
public java.lang.StringBuilder | append(char c)Appends the string representation of the specified {@code char} value.
The {@code char} value is converted to a string according to the rule
defined by {@link String#valueOf(char)}.
append0(c);
return this;
|
public java.lang.StringBuilder | append(int i)Appends the string representation of the specified {@code int} value. The
{@code int} value is converted to a string according to the rule defined
by {@link String#valueOf(int)}.
append0(Integer.toString(i));
return this;
|
public java.lang.StringBuilder | append(long lng)Appends the string representation of the specified {@code long} value.
The {@code long} value is converted to a string according to the rule
defined by {@link String#valueOf(long)}.
append0(Long.toString(lng));
return this;
|
public java.lang.StringBuilder | append(float f)Appends the string representation of the specified {@code float} value.
The {@code float} value is converted to a string according to the rule
defined by {@link String#valueOf(float)}.
append0(Float.toString(f));
return this;
|
public java.lang.StringBuilder | appendCodePoint(int codePoint)Appends the encoded Unicode code point. The code point is converted to a
{@code char[]} as defined by {@link Character#toChars(int)}.
append0(Character.toChars(codePoint));
return this;
|
public java.lang.StringBuilder | delete(int start, int end)Deletes a sequence of characters specified by {@code start} and {@code
end}. Shifts any remaining characters to the left.
delete0(start, end);
return this;
|
public java.lang.StringBuilder | deleteCharAt(int index)Deletes the character at the specified index. shifts any remaining
characters to the left.
deleteCharAt0(index);
return this;
|
public java.lang.StringBuilder | insert(int offset, boolean b)Inserts the string representation of the specified {@code boolean} value
at the specified {@code offset}. The {@code boolean} value is converted
to a string according to the rule defined by
{@link String#valueOf(boolean)}.
insert0(offset, b ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
return this;
|
public java.lang.StringBuilder | insert(int offset, char c)Inserts the string representation of the specified {@code char} value at
the specified {@code offset}. The {@code char} value is converted to a
string according to the rule defined by {@link String#valueOf(char)}.
insert0(offset, c);
return this;
|
public java.lang.StringBuilder | insert(int offset, int i)Inserts the string representation of the specified {@code int} value at
the specified {@code offset}. The {@code int} value is converted to a
String according to the rule defined by {@link String#valueOf(int)}.
insert0(offset, Integer.toString(i));
return this;
|
public java.lang.StringBuilder | insert(int offset, long l)Inserts the string representation of the specified {@code long} value at
the specified {@code offset}. The {@code long} value is converted to a
String according to the rule defined by {@link String#valueOf(long)}.
insert0(offset, Long.toString(l));
return this;
|
public java.lang.StringBuilder | insert(int offset, float f)Inserts the string representation of the specified {@code float} value at
the specified {@code offset}. The {@code float} value is converted to a
string according to the rule defined by {@link String#valueOf(float)}.
insert0(offset, Float.toString(f));
return this;
|
public java.lang.StringBuilder | insert(int offset, double d)Inserts the string representation of the specified {@code double} value
at the specified {@code offset}. The {@code double} value is converted
to a String according to the rule defined by
{@link String#valueOf(double)}.
insert0(offset, Double.toString(d));
return this;
|
public java.lang.StringBuilder | insert(int offset, java.lang.Object obj)Inserts the string representation of the specified {@code Object} at the
specified {@code offset}. The {@code Object} value is converted to a
String according to the rule defined by {@link String#valueOf(Object)}.
insert0(offset, obj == null ? "null" : obj.toString()); //$NON-NLS-1$
return this;
|
public java.lang.StringBuilder | insert(int offset, java.lang.String str)Inserts the specified string at the specified {@code offset}. If the
specified string is null, then the String {@code "null"} is inserted.
insert0(offset, str);
return this;
|
public java.lang.StringBuilder | insert(int offset, char[] ch)Inserts the string representation of the specified {@code char[]} at the
specified {@code offset}. The {@code char[]} value is converted to a
String according to the rule defined by {@link String#valueOf(char[])}.
insert0(offset, ch);
return this;
|
public java.lang.StringBuilder | insert(int offset, char[] str, int strOffset, int strLen)Inserts the string representation of the specified subsequence of the
{@code char[]} at the specified {@code offset}. The {@code char[]} value
is converted to a String according to the rule defined by
{@link String#valueOf(char[],int,int)}.
insert0(offset, str, strOffset, strLen);
return this;
|
public java.lang.StringBuilder | insert(int offset, java.lang.CharSequence s)Inserts the string representation of the specified {@code CharSequence}
at the specified {@code offset}. The {@code CharSequence} is converted
to a String as defined by {@link CharSequence#toString()}. If {@code s}
is {@code null}, then the String {@code "null"} is inserted.
insert0(offset, s == null ? "null" : s.toString()); //$NON-NLS-1$
return this;
|
public java.lang.StringBuilder | insert(int offset, java.lang.CharSequence s, int start, int end)Inserts the string representation of the specified subsequence of the
{@code CharSequence} at the specified {@code offset}. The {@code
CharSequence} is converted to a String as defined by
{@link CharSequence#subSequence(int, int)}. If the {@code CharSequence}
is {@code null}, then the string {@code "null"} is used to determine the
subsequence.
insert0(offset, s, start, end);
return this;
|
private void | readObject(java.io.ObjectInputStream in)Reads the state of a {@code StringBuilder} from the passed stream and
restores it to this instance.
in.defaultReadObject();
int count = in.readInt();
char[] value = (char[]) in.readObject();
set(value, count);
|
public java.lang.StringBuilder | replace(int start, int end, java.lang.String str)Replaces the specified subsequence in this builder with the specified
string.
replace0(start, end, str);
return this;
|
public java.lang.StringBuilder | reverse()Reverses the order of characters in this builder.
reverse0();
return this;
|
public java.lang.String | toString()Returns the contents of this builder.
/* Note: This method is required to workaround a compiler bug
* in the RI javac (at least in 1.5.0_06) that will generate a
* reference to the non-public AbstractStringBuilder if we don't
* override it here.
*/
return super.toString();
|
private void | writeObject(java.io.ObjectOutputStream out)Writes the state of this object to the stream passed.
out.defaultWriteObject();
out.writeInt(length());
out.writeObject(getValue());
|