java.lang
Class StringBuffer

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

public class StringBuffer
extends Object


Constructor Summary
StringBuffer()
          A flag indicating whether the buffer is shared
StringBuffer(int length)
          Constructs a string buffer with no characters in it and an initial capacity specified by the length argument.
StringBuffer(String str)
          Constructs a string buffer so that it represents the same sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the argument string.
 
Method Summary
 StringBuffer append(char c)
           
 StringBuffer append(char[] str, int offset, int len)
           
 StringBuffer append(int i)
           
 StringBuffer append(Object obj)
           
 StringBuffer append(String str)
           
 int length()
          Returns the length (character count) of this string buffer.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, println, toString
 

Constructor Detail

StringBuffer

public StringBuffer()
A flag indicating whether the buffer is shared


StringBuffer

public StringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length argument.

Parameters:
length - the initial capacity.
Throws:
NegativeArraySizeException - if the length argument is less than 0.

StringBuffer

public StringBuffer(String str)
Constructs a string buffer so that it represents the same sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the argument string. The initial capacity of the string buffer is 16 plus the length of the string argument.

Parameters:
str - the initial contents of the buffer.
Throws:
NullPointerException - if str is null
Method Detail

length

public int length()
Returns the length (character count) of this string buffer.

Returns:
the length of the sequence of characters currently represented by this string buffer.

append

public StringBuffer append(Object obj)

append

public StringBuffer append(int i)

append

public StringBuffer append(String str)

append

public StringBuffer append(char c)

append

public StringBuffer append(char[] str,
                           int offset,
                           int len)