|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.AbstractStringBuilder
abstract class AbstractStringBuilder
A modifiable sequence of characters for use in creating
and modifying Strings. This class is intended as a base class for
StringBuffer and StringBuilder.
StringBuffer,
StringBuilder| Field Summary | |
|---|---|
(package private) static int |
INITIAL_CAPACITY
|
| Constructor Summary | |
|---|---|
AbstractStringBuilder()
|
|
AbstractStringBuilder(int capacity)
|
|
AbstractStringBuilder(String string)
|
|
| Method Summary | |
|---|---|
(package private) void |
append0(char ch)
|
(package private) void |
append0(char[] chars)
|
(package private) void |
append0(char[] chars,
int start,
int length)
|
(package private) void |
append0(CharSequence s,
int start,
int end)
|
(package private) void |
append0(String string)
|
(package private) void |
appendNull()
|
int |
capacity()
Returns the number of characters this StringBuffer can hold without growing. |
char |
charAt(int index)
Retrieves the character at the index. |
int |
codePointAt(int index)
Retrieves the Unicode code point value at the index. |
int |
codePointBefore(int index)
Retrieves the Unicode code point value that precedes the index. |
int |
codePointCount(int beginIndex,
int endIndex)
Calculates the number of Unicode code points between beginIndex and endIndex. |
(package private) void |
delete0(int start,
int end)
|
(package private) void |
deleteCharAt0(int location)
|
void |
ensureCapacity(int min)
Ensures that this object has a minimum capacity available before requiring the internal buffer to be enlarged. |
void |
getChars(int start,
int end,
char[] dest,
int destStart)
Copies the requested sequence of characters to be copied to the char[] passed. |
(package private) char[] |
getValue()
|
int |
indexOf(String string)
Searches in this StringBuffer for the first index of the specified character. |
int |
indexOf(String subString,
int start)
Searches in this StringBuffer for the index of the specified character. |
(package private) void |
insert0(int index,
char ch)
|
(package private) void |
insert0(int index,
char[] chars)
|
(package private) void |
insert0(int index,
char[] chars,
int start,
int length)
|
(package private) void |
insert0(int index,
CharSequence s,
int start,
int end)
|
(package private) void |
insert0(int index,
String string)
|
int |
lastIndexOf(String string)
Searches in this StringBuffer for the last index of the specified character. |
int |
lastIndexOf(String subString,
int start)
Searches in this StringBuffer for the index of the specified character. |
int |
length()
The current length of this object. |
int |
offsetByCodePoints(int index,
int codePointOffset)
Returns the index within this object that is offset from index by codePointOffset code points. |
(package private) void |
replace0(int start,
int end,
String string)
|
(package private) void |
reverse0()
|
(package private) void |
set(char[] val,
int len)
|
void |
setCharAt(int index,
char ch)
Sets the character at the index in this object. |
void |
setLength(int length)
Sets the current length to a new value. |
(package private) char[] |
shareValue()
|
CharSequence |
subSequence(int start,
int end)
Returns a CharSequence of the subsequence of this object
from the start index to the start index. |
String |
substring(int start)
Returns the String value of the subsequence of this object from the start index to the current end. |
String |
substring(int start,
int end)
Returns the String value of the subsequence of this object from the start index to the start index. |
String |
toString()
Returns the current String representation of this object. |
void |
trimToSize()
Trims off any extra capacity beyond the current length. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final int INITIAL_CAPACITY
| Constructor Detail |
|---|
AbstractStringBuilder()
AbstractStringBuilder(int capacity)
AbstractStringBuilder(String string)
| Method Detail |
|---|
final char[] getValue()
final char[] shareValue()
final void set(char[] val,
int len)
throws InvalidObjectException
InvalidObjectExceptionfinal void appendNull()
final void append0(char[] chars)
final void append0(char[] chars,
int start,
int length)
final void append0(char ch)
final void append0(String string)
final void append0(CharSequence s,
int start,
int end)
public int capacity()
ensureCapacity(int),
length()public char charAt(int index)
Retrieves the character at the index.
index - index of character in this object to retrieve.
IndexOutOfBoundsException - if index is negative or greater than or equal
to the current length().
final void delete0(int start,
int end)
final void deleteCharAt0(int location)
public void ensureCapacity(int min)
Ensures that this object has a minimum capacity available before
requiring the internal buffer to be enlarged. The general policy of this
method is that if the minimumCapacity is larger than the
current capacity(), then the capacity will be increased to the
largest value of either the minimumCapacity or the current
capacity multiplied by two plus two. Although this is the general policy,
there is no guarantee that the capacity will change.
min - The new minimum capacity to set.
public void getChars(int start,
int end,
char[] dest,
int destStart)
Copies the requested sequence of characters to be copied to the
char[] passed.
start - The inclusive start index of the characters to copy from this
object.end - The exclusive end index of the characters to copy from this
object.dest - The char[] to copy the characters to.destStart - The inclusive start index of the dest parameter
to begin copying to.
IndexOutOfBoundsException - if the start is negative, the
destStart is negative, the start
is greater than end, the end
is greater than the current length() or
destStart + end - begin is greater than
dest.length.
final void insert0(int index,
char[] chars)
final void insert0(int index,
char[] chars,
int start,
int length)
final void insert0(int index,
char ch)
final void insert0(int index,
String string)
final void insert0(int index,
CharSequence s,
int start,
int end)
public int length()
The current length of this object.
final void replace0(int start,
int end,
String string)
final void reverse0()
public void setCharAt(int index,
char ch)
Sets the character at the index in this object.
index - the zero-based index of the character to replace.ch - the character to set.
IndexOutOfBoundsException - if index is negative or greater than or equal
to the current length().public void setLength(int length)
Sets the current length to a new value. If the new length is larger than
the current length, then the new characters at the end of this object
will contain the char value of