java.lang
Class StringBuilder
- java.lang.Object
-
- java.lang.StringBuffer
-
- java.lang.StringBuilder
-
public final class StringBuilder extends StringBuffer
-
-
Constructor Summary
Constructors Constructor and Description StringBuilder()
StringBuilder(int capacity)
StringBuilder(String string)
-
Method Summary
Methods Modifier and Type Method and Description StringBuilder
append(boolean b)
Adds the string representation of the specified boolean to the end of this StringBuffer.StringBuilder
append(char ch)
Adds the specified character to the end of this buffer.StringBuilder
append(char[] chars)
Adds the character array to the end of this buffer.StringBuilder
append(char[] chars, int offset, int length)
Adds the specified sequence of characters to the end of this buffer.StringBuilder
append(int i)
Adds the string representation of the specified integer to the end of this StringBuffer.StringBuilder
append(long l)
Adds the string representation of the specified long to the end of this StringBuffer.StringBuilder
append(Object obj)
Adds the string representation of the specified object to the end of this StringBuffer.StringBuilder
append(String string)
Adds the specified string to the end of this buffer.
-
-
-
Constructor Detail
-
StringBuilder
public StringBuilder()
-
StringBuilder
public StringBuilder(int capacity)
-
StringBuilder
public StringBuilder(String string)
-
-
Method Detail
-
append
public StringBuilder append(char[] chars)
Description copied from class:StringBuffer
Adds the character array to the end of this buffer.- Overrides:
append
in classStringBuffer
- Parameters:
chars
- the character array to append.- Returns:
- this StringBuffer.
-
append
public StringBuilder append(char[] chars, int offset, int length)
Description copied from class:StringBuffer
Adds the specified sequence of characters to the end of this buffer.- Overrides:
append
in classStringBuffer
- Parameters:
chars
- the character array to append.length
- the number of characters.- Returns:
- this StringBuffer.
-
append
public StringBuilder append(String string)
Description copied from class:StringBuffer
Adds the specified string to the end of this buffer.If the specified string is
null
the string"null"
is appended, otherwise the contents of the specified string is appended.- Overrides:
append
in classStringBuffer
- Parameters:
string
- the string to append (may be null).- Returns:
- this StringBuffer.
-
append
public StringBuilder append(int i)
Description copied from class:StringBuffer
Adds the string representation of the specified integer to the end of this StringBuffer.- Overrides:
append
in classStringBuffer
- Parameters:
i
- the integer to append.- Returns:
- this StringBuffer.
- See Also:
String.valueOf(int)
-
append
public StringBuilder append(long l)
Description copied from class:StringBuffer
Adds the string representation of the specified long to the end of this StringBuffer.- Overrides:
append
in classStringBuffer
- Parameters:
l
- the long to append.- Returns:
- this StringBuffer.
- See Also:
String.valueOf(long)
-
append
public StringBuilder append(Object obj)
Description copied from class:StringBuffer
Adds the string representation of the specified object to the end of this StringBuffer.If the specified object is
null
the string"null"
is appended, otherwise the objectstoString
is used to get its string representation.- Overrides:
append
in classStringBuffer
- Parameters:
obj
- the object to append (may be null).- Returns:
- this StringBuffer.
- See Also:
String.valueOf(Object)
-
append
public StringBuilder append(char ch)
Description copied from class:StringBuffer
Adds the specified character to the end of this buffer.- Overrides:
append
in classStringBuffer
- Parameters:
ch
- the character to append.- Returns:
- this StringBuffer.
- See Also:
String.valueOf(char)
-
append
public StringBuilder append(boolean b)
Description copied from class:StringBuffer
Adds the string representation of the specified boolean to the end of this StringBuffer.If the argument is
true
the string"true"
is appended, otherwise the string"false"
is appended.- Overrides:
append
in classStringBuffer
- Parameters:
b
- the boolean to append.- Returns:
- this StringBuffer.
- See Also:
String.valueOf(boolean)
-
-