java.lang
Class StringBuilder

java.lang.Object
  extended by java.lang.StringBuilder

public class StringBuilder
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
StringBuilder()
           
StringBuilder(int length)
           
StringBuilder(String aString)
           
 
Method Summary
 StringBuilder append(boolean aBoolean)
           
 StringBuilder append(char aChar)
           
 StringBuilder append(char[] c)
           
 StringBuilder append(char[] c, int off, int len)
           
 StringBuilder append(CharSequence cs)
           
 StringBuilder append(CharSequence cs, int start, int end)
           
 StringBuilder append(double aDouble)
           
 StringBuilder append(float aFloat)
           
 StringBuilder append(int i)
           
 StringBuilder append(long aLong)
           
 StringBuilder append(Object aObject)
           
 StringBuilder append(String s)
           
 char charAt(int i)
           
 StringBuilder delete(int start, int end)
           
 void ensureCapacity(int minCapacity)
           
 char[] getChars()
          Retrieves the contents of the StringBuilder 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

StringBuilder

public StringBuilder()

StringBuilder

public StringBuilder(String aString)

StringBuilder

public StringBuilder(int length)
Method Detail

ensureCapacity

public void ensureCapacity(int minCapacity)

delete

public StringBuilder delete(int start,
                            int end)

append

public StringBuilder append(String s)

append

public StringBuilder append(Object aObject)

append

public StringBuilder append(boolean aBoolean)

append

public StringBuilder append(char aChar)

append

public StringBuilder append(char[] c)

append

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

append

public StringBuilder append(CharSequence cs)

append

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

append

public StringBuilder append(int i)

append

public StringBuilder append(long aLong)

append

public StringBuilder append(float aFloat)

append

public StringBuilder 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 StringBuilder in the form of an array of characters.


substring

public String substring(int start)

substring

public String substring(int start,
                        int end)