Methods Summary |
---|
public synchronized java.lang.StringBuffer | append(java.lang.Object obj)
super.append(String.valueOf(obj));
return this;
|
public synchronized java.lang.StringBuffer | append(java.lang.String str)
super.append(str);
return this;
|
public synchronized java.lang.StringBuffer | append(java.lang.StringBuffer sb)Appends the specified StringBuffer to this sequence.
The characters of the StringBuffer argument are appended,
in order, to the contents of this StringBuffer, increasing the
length of this StringBuffer by the length of the argument.
If sb is null, then the four characters
"null" are appended to this StringBuffer.
Let n be the length of the old character sequence, the one
contained in the StringBuffer just prior to execution of the
append method. Then the character at index k in
the new character sequence is equal to the character at index k
in the old character sequence, if k is less than n;
otherwise, it is equal to the character at index k-n in the
argument sb .
This method synchronizes on this (the destination)
object but does not synchronize on the source (sb ).
super.append(sb);
return this;
|
public java.lang.StringBuffer | append(java.lang.CharSequence s)Appends the specified CharSequence to this
sequence.
The characters of the CharSequence argument are appended,
in order, increasing the length of this sequence by the length of the
argument.
The result of this method is exactly the same as if it were an
invocation of this.append(s, 0, s.length());
This method synchronizes on this (the destination)
object but does not synchronize on the source (s ).
If s is null , then the four characters
"null" are appended.
// Note, synchronization achieved via other invocations
if (s == null)
s = "null";
if (s instanceof String)
return this.append((String)s);
if (s instanceof StringBuffer)
return this.append((StringBuffer)s);
return this.append(s, 0, s.length());
|
public synchronized java.lang.StringBuffer | append(java.lang.CharSequence s, int start, int end)
super.append(s, start, end);
return this;
|
public synchronized java.lang.StringBuffer | append(char[] str)
super.append(str);
return this;
|
public synchronized java.lang.StringBuffer | append(char[] str, int offset, int len)
super.append(str, offset, len);
return this;
|
public synchronized java.lang.StringBuffer | append(boolean b)
super.append(b);
return this;
|
public synchronized java.lang.StringBuffer | append(char c)
super.append(c);
return this;
|
public synchronized java.lang.StringBuffer | append(int i)
super.append(i);
return this;
|
public synchronized java.lang.StringBuffer | append(long lng)
super.append(lng);
return this;
|
public synchronized java.lang.StringBuffer | append(float f)
new FloatingDecimal(f).appendTo(this);
return this;
|
public synchronized java.lang.StringBuffer | append(double d)
new FloatingDecimal(d).appendTo(this);
return this;
|
public synchronized java.lang.StringBuffer | appendCodePoint(int codePoint)
super.appendCodePoint(codePoint);
return this;
|
public synchronized int | capacity()
return value.length;
|
public synchronized char | charAt(int index)
if ((index < 0) || (index >= count))
throw new StringIndexOutOfBoundsException(index);
return value[index];
|
public synchronized int | codePointAt(int index)
return super.codePointAt(index);
|
public synchronized int | codePointBefore(int index)
return super.codePointBefore(index);
|
public synchronized int | codePointCount(int beginIndex, int endIndex)
return super.codePointCount(beginIndex, endIndex);
|
public synchronized java.lang.StringBuffer | delete(int start, int end)
super.delete(start, end);
return this;
|
public synchronized java.lang.StringBuffer | deleteCharAt(int index)
super.deleteCharAt(index);
return this;
|
public synchronized void | ensureCapacity(int minimumCapacity)
if (minimumCapacity > value.length) {
expandCapacity(minimumCapacity);
}
|
public synchronized void | getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
super.getChars(srcBegin, srcEnd, dst, dstBegin);
|
public int | indexOf(java.lang.String str)
return indexOf(str, 0);
|
public synchronized int | indexOf(java.lang.String str, int fromIndex)
return String.indexOf(value, 0, count,
str.toCharArray(), 0, str.length(), fromIndex);
|
public synchronized java.lang.StringBuffer | insert(int index, char[] str, int offset, int len)
super.insert(index, str, offset, len);
return this;
|
public synchronized java.lang.StringBuffer | insert(int offset, java.lang.Object obj)
super.insert(offset, String.valueOf(obj));
return this;
|
public synchronized java.lang.StringBuffer | insert(int offset, java.lang.String str)
super.insert(offset, str);
return this;
|
public synchronized java.lang.StringBuffer | insert(int offset, char[] str)
super.insert(offset, str);
return this;
|
public java.lang.StringBuffer | insert(int dstOffset, java.lang.CharSequence s)
// Note, synchronization achieved via other invocations
if (s == null)
s = "null";
if (s instanceof String)
return this.insert(dstOffset, (String)s);
return this.insert(dstOffset, s, 0, s.length());
|
public synchronized java.lang.StringBuffer | insert(int dstOffset, java.lang.CharSequence s, int start, int end)
super.insert(dstOffset, s, start, end);
return this;
|
public java.lang.StringBuffer | insert(int offset, boolean b)
return insert(offset, String.valueOf(b));
|
public synchronized java.lang.StringBuffer | insert(int offset, char c)
super.insert(offset, c);
return this;
|
public java.lang.StringBuffer | insert(int offset, int i)
return insert(offset, String.valueOf(i));
|
public java.lang.StringBuffer | insert(int offset, long l)
return insert(offset, String.valueOf(l));
|
public java.lang.StringBuffer | insert(int offset, float f)
return insert(offset, String.valueOf(f));
|
public java.lang.StringBuffer | insert(int offset, double d)
return insert(offset, String.valueOf(d));
|
public int | lastIndexOf(java.lang.String str)
// Note, synchronization achieved via other invocations
return lastIndexOf(str, count);
|
public synchronized int | lastIndexOf(java.lang.String str, int fromIndex)
return String.lastIndexOf(value, 0, count,
str.toCharArray(), 0, str.length(), fromIndex);
|
public synchronized int | length()
return count;
|
public synchronized int | offsetByCodePoints(int index, int codePointOffset)
return super.offsetByCodePoints(index, codePointOffset);
|
private void | readObject(java.io.ObjectInputStream s)readObject is called to restore the state of the StringBuffer from
a stream.
java.io.ObjectInputStream.GetField fields = s.readFields();
value = (char[])fields.get("value", null);
count = (int)fields.get("count", 0);
|
public synchronized java.lang.StringBuffer | replace(int start, int end, java.lang.String str)
super.replace(start, end, str);
return this;
|
public synchronized java.lang.StringBuffer | reverse()
super.reverse();
return this;
|
public synchronized void | setCharAt(int index, char ch)
if ((index < 0) || (index >= count))
throw new StringIndexOutOfBoundsException(index);
value[index] = ch;
|
public synchronized void | setLength(int newLength)
super.setLength(newLength);
|
public synchronized java.lang.CharSequence | subSequence(int start, int end)
return super.substring(start, end);
|
public synchronized java.lang.String | substring(int start)
return substring(start, count);
|
public synchronized java.lang.String | substring(int start, int end)
return super.substring(start, end);
|
public synchronized java.lang.String | toString()
return new String(value, 0, count);
|
public synchronized void | trimToSize()
super.trimToSize();
|
private synchronized void | writeObject(java.io.ObjectOutputStream s)readObject is called to restore the state of the StringBuffer from
a stream.
java.io.ObjectOutputStream.PutField fields = s.putFields();
fields.put("value", value);
fields.put("count", count);
fields.put("shared", false);
s.writeFields();
|