java.lang
Class StringBuffer

java.lang.Object
  extended by java.lang.StringBuffer

public final class StringBuffer
extends Object

An expandable string of characters. Actually not very expandable! 09/25/2001 added number formatting thanks to Martin E. Nielsen. You must ensure that the buffer is large enough to take the formatted number.

Author:
Martin E. Nielsen, Sven Köhler

Constructor Summary
StringBuffer()
           
StringBuffer(int length)
           
StringBuffer(String aString)
           
 
Method Summary
 StringBuffer append(boolean aBoolean)
           
 StringBuffer append(char aChar)
           
 StringBuffer append(char[] c)
           
 StringBuffer append(char[] c, int off, int len)
           
 StringBuffer append(CharSequence cs)
           
 StringBuffer append(CharSequence cs, int start, int end)
           
 StringBuffer append(double aDouble)
           
 StringBuffer append(float aFloat)
           
 StringBuffer append(int i)
           
 StringBuffer append(long aLong)
           
 StringBuffer append(Object aObject)
           
 StringBuffer append(String s)
           
 char charAt(int i)
           
 StringBuffer delete(int start, int end)
           
 void ensureCapacity(int minCapacity)
           
 char[] getChars()
          Retrieves the contents of the StringBuffer in the form of an array of characters.
 int indexOf(String str)
           
 int indexOf(String str, int fromIndex)
           
 int lastIndexOf(String str)
           
 int lastIndexOf(String str, int fromIndex)
           
 int length()
           
 void setCharAt(int i, char ch)
           
 String substring(int start)
           
 String substring(int start, int end)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringBuffer

public StringBuffer()

StringBuffer

public StringBuffer(String aString)

StringBuffer

public StringBuffer(int length)
Method Detail

ensureCapacity

public void ensureCapacity(int minCapacity)

delete

public StringBuffer delete(int start,
                           int end)

append

public StringBuffer append(String s)

append

public StringBuffer append(Object aObject)

append

public StringBuffer append(boolean aBoolean)

append

public StringBuffer append(char aChar)

append

public StringBuffer append(char[] c)

append

public StringBuffer append(char[] c,
                           int off,
                           int len)

append

public StringBuffer append(CharSequence cs)

append

public StringBuffer append(CharSequence cs,
                           int start,
                           int end)

append

public StringBuffer append(int i)

append

public StringBuffer append(long aLong)

append

public StringBuffer append(float aFloat)

append

public StringBuffer append(double aDouble)

indexOf

public int indexOf(String str)

indexOf

public int indexOf(String str,
                   int fromIndex)

lastIndexOf

public int lastIndexOf(String str)

lastIndexOf

public int lastIndexOf(String str,
                       int fromIndex)

toString

public String toString()
Overrides:
toString in class Object

charAt

public char charAt(int i)

setCharAt

public void setCharAt(int i,
                      char ch)

length

public int length()

getChars

public char[] getChars()
Retrieves the contents of the StringBuffer in the form of an array of characters.


substring

public String substring(int start)

substring

public String substring(int start,
                        int end)