|
DthingApi
|
A modifiable sequence of characters for use in creating strings. This class is intended as a direct replacement of StringBuffer for non-concurrent use; unlike
this class is not synchronized.
For particularly complex string-building needs, consider java.util.Formatter.
The majority of the modification methods on this class return
so that method calls can be chained together. For example:
.
|
inline |
Constructs an instance with an initial capacity of
.
|
inline |
Constructs an instance with the specified capacity.
| capacity | the initial capacity to use. |
| NegativeArraySizeException | if the specified capacity |
|
inline |
Constructs an instance that's initialized with the contents of the specified
. The capacity of the new builder will be the length of the
plus 16.
| str | the String |
| NullPointerException | if str null |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a String according to the rule defined by String#valueOf(boolean).
| b | the boolean |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a string according to the rule defined by String#valueOf(char).
| c | the char |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a string according to the rule defined by String#valueOf(int).
| i | the int |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a string according to the rule defined by String#valueOf(long).
| l | the long |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a string according to the rule defined by String#valueOf(float).
| f | the float |
|
inline |
Appends the string representation of the specified
value. The
value is converted to a string according to the rule defined by String#valueOf(double).
| d | the double |
|
inline |
Appends the string representation of the specified
. The
value is converted to a string according to the rule defined by String#valueOf(Object).
| obj | the Object |
|
inline |
Appends the contents of the specified string. If the string is
, then the string
is appended.
| str | the string to append. |
|
inline |
Appends the contents of the specified
. If the StringBuffer is
, then the string
is appended.
| sb | the StringBuffer |
|
inline |
Appends the string representation of the specified
. The
is converted to a string according to the rule defined by String#valueOf(char[]).
| chars | the char[] |
|
inline |
Appends the string representation of the specified subset of the
. The
value is converted to a String according to the rule defined by String#valueOf(char[],int,int).
| str | the char[] |
| offset | the inclusive offset index. |
| len | the number of characters. |
| ArrayIndexOutOfBoundsException | if offset len |
|
inline |
Deletes a sequence of characters specified by
and
. Shifts any remaining characters to the left.
| start | the inclusive start index. |
| end | the exclusive end index. |
| StringIndexOutOfBoundsException | if start end |
|
inline |
Deletes the character at the specified index. shifts any remaining characters to the left.
| index | the index of the character to delete. |
| StringIndexOutOfBoundsException | if index |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a string according to the rule defined by String#valueOf(boolean).
| offset | the index to insert at. |
| b | the boolean |
| StringIndexOutOfBoundsException | if offset length |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a string according to the rule defined by String#valueOf(char).
| offset | the index to insert at. |
| c | the char |
| IndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(int).
| offset | the index to insert at. |
| i | the int |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(long).
| offset | the index to insert at. |
| l | the long |
| StringIndexOutOfBoundsException | if offset |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a string according to the rule defined by String#valueOf(float).
| offset | the index to insert at. |
| f | the float |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified
value at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(double).
| offset | the index to insert at. |
| d | the double |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified
at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(Object).
| offset | the index to insert at. |
| obj | the Object |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the specified string at the specified
. If the specified string is null, then the String
is inserted.
| offset | the index to insert at. |
| str | the String |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified
at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(char[]).
| offset | the index to insert at. |
| ch | the char[] |
| StringIndexOutOfBoundsException | if offset length() |
|
inline |
Inserts the string representation of the specified subsequence of the
at the specified
. The
value is converted to a String according to the rule defined by String#valueOf(char[],int,int).
| offset | the index to insert at. |
| str | the char[] |
| strOffset | the inclusive index. |
| strLen | the number of characters. |
| StringIndexOutOfBoundsException | if offset length() strOffset strLen |
|
inline |
Replaces the specified subsequence in this builder with the specified string.
| start | the inclusive begin index. |
| end | the exclusive end index. |
| str | the replacement string. |
| StringIndexOutOfBoundsException | if start length() end |
| NullPointerException | if str null |
|
inline |
Reverses the order of characters in this builder.
|
inline |
Returns the contents of this builder.
1.8.13