java.lang.StringBuffer (JDK 1.0)
This class represents a string of characters. It differs from the String class in that its contents may be modified. A StringBuffer object grows in length as necessary. The string stored in a StringBuffer object may be modified in place with the setCharAt(), append(), and insert() methods.
After a string is processed in a StringBuffer object, it may be efficiently converted to a String object for subsequent use. The StringBuffer.toString() method does not copy the internal array of characters; instead it shares that array with the new String object, and makes a new copy for itself only when further modifications are made to the StringBuffer object.
public final classStringBufferextends Object implements Serializable { //Public ConstructorspublicStringBuffer(); publicStringBuffer(intlength); publicStringBuffer(Stringstr); //Public Instance Methodspublic synchronized StringBufferappend(Objectobj); public synchronized StringBufferappend(Stringstr); public synchronized StringBufferappend(char[]str); public synchronized StringBufferappend(char[]str, intoffset, intlen); public StringBufferappend(booleanb); public synchronized StringBufferappend(charc); public StringBufferappend(inti); public StringBufferappend(longl); public StringBufferappend(floatf); public StringBufferappend(doubled); public intcapacity(); public synchronized charcharAt(intindex); public synchronized voidensureCapacity(intminimumCapacity); public synchronized voidgetChars(intsrcBegin, intsrcEnd, char[]dst, intdstBegin); public synchronized StringBufferinsert(intoffset, Objectobj); public synchronized StringBufferinsert(intoffset, Stringstr); public synchronized StringBufferinsert(intoffset, char[]str); public StringBufferinsert(intoffset, booleanb); public synchronized StringBufferinsert(intoffset, charc); public StringBufferinsert(intoffset, inti); public StringBufferinsert(intoffset, longl); public StringBufferinsert(intoffset, floatf); public StringBufferinsert(intoffset, doubled); public intlength(); public synchronized StringBufferreverse(); public synchronized voidsetCharAt(intindex, charch); public synchronized voidsetLength(intnewLength); public StringtoString(); //Overrides Object}
Passed To:
ChoiceFormat.format(), DateFormat.format(), DecimalFormat.format(), Format.format(), MessageFormat.format(), NumberFormat.format(), SimpleDateFormat.format(), String()
Returned By:
ChoiceFormat.format(), DateFormat.format(), DecimalFormat.format(), Format.format(), MessageFormat.format(), NumberFormat.format(), SimpleDateFormat.format(), StringBuffer.append(), StringBuffer.insert(), StringBuffer.reverse(), StringWriter.getBuffer()