Implements a modifiable string. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.
Unless otherwise noted, passing a null argument to a constructor
or method in this class will cause a NullPointerException to be
thrown.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte | coder
The id of the encoding used to encode the bytes in |
| pack-priv int | count
The count is the number of characters used. |
| private static final byte[] | |
| pack-priv boolean | maybeLatin1
The attribute indicates |
| pack-priv byte[] | value
The value is used for character storage. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | AbstractStringBuilder(String
the string to copy. str)Constructs an AbstractStringBuilder that contains the same characters
as the specified |
| pack-priv | AbstractStringBuilder(CharSequence
the sequence to copy. seq)Constructs an AbstractStringBuilder that contains the same characters
as the specified |
| Modifier and Type | Method and Description |
|---|---|
| public AbstractStringBuilder | |
| public AbstractStringBuilder | |
| public AbstractStringBuilder | Returns: a reference to this object.the sb)StringBuffer to append.Appends the specified |
| pack-priv AbstractStringBuilder | |
| public AbstractStringBuilder | append(CharSequence s)
Implements java. Appends the specified character sequence to this |
| public AbstractStringBuilder | Returns: a reference to this object.the sequence to append. s, int the starting index of the subsequence to be appended. start, int the end index of the subsequence to be appended. end)Implements java. Appends a subsequence of the specified |
| public AbstractStringBuilder | Returns: a reference to this object.the characters to be appended. str)Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the characters to be appended. str, int the index of the first offset, int char to append.the number of len)chars to append.Appends the string representation of a subarray of the
|
| public AbstractStringBuilder | Returns: a reference to this object.a b)boolean.Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.a c)char.Implements java. Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.an i)int.Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.a l)long.Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.a f)float.Appends the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.a d)double.Appends the string representation of the |
| private static byte[] | Returns: buffer with new characters appended, possibly inflatedthe current buffer value, byte the coder of the buffer coder, int the character count count, char[] a char array s, int the offset of the first character to append off, int end last (exclusive) character to append end)Returns buffer with new characters appended, possibly inflated. |
| private static byte[] | Returns: buffer with new characters appended, possibly inflatedthe current buffer value, byte the coder of the buffer coder, int the character count count, String a string s, int the offset of the first character to append off, int end last (exclusive) character to append end)Returns buffer with new characters appended, possibly inflated. |
| private static byte[] | Returns: buffer with new characters appended, possibly inflatedthe current buffer value, byte the coder of the buffer coder, int the character count count, CharSequence CharSequence to append characters from s, int the offset of the first character to append off, int end last (exclusive) character to append end)Returns buffer with new characters appended, possibly inflated. |
| public AbstractStringBuilder | Returns: a reference to this object.a Unicode code point codePoint)Appends the string representation of the |
| private AbstractStringBuilder | |
| public int | |
| public char | Returns: thechar value at the specified index.the index of the desired index)char value.Implements java. Returns the |
| public IntStream | chars()
Overrides default java. Returns a stream of |
| public int | Returns: the code point value of the character at theindexthe index to the index)char valuesReturns the character (Unicode code point) at the specified index. |
| public int | Returns: the Unicode code point value before the given index.the index following the code point that should be returned index)Returns the character (Unicode code point) before the specified index. |
| public int | Returns: the number of Unicode code points in the specified text rangethe index to the first beginIndex, int char of
the text range.the index after the last endIndex)char of
the text range.Returns the number of Unicode code points in the specified text range of this sequence. |
| public IntStream | codePoints()
Overrides default java. Returns a stream of code point values from this sequence. |
| pack-priv int | compareTo(AbstractStringBuilder another)
Compares the objects of two AbstractStringBuilder implementations lexicographically. |
| public AbstractStringBuilder | Returns: This object.The beginning index, inclusive. start, int The ending index, exclusive. end)Removes the characters in a substring of this sequence. |
| public AbstractStringBuilder | Returns: This object.Index of index)char to removeRemoves the |
| public void | ensureCapacity(int
the minimum desired capacity. minimumCapacity)Ensures that the capacity is at least equal to the specified minimum. |
| private static byte[] | Returns: the value, with the requested coder, in a buffer with at least the minimum capacitythe current buffer value, byte of the current buffer coder, int the count of chars in the current buffer count, int the new minimum capacity minimumCapacity, byte the desired new coder newCoder)Returns the value, with the requested coder, in a buffer with at least the minimum capacity. |
| private static byte[] | Returns: the value buffer sufficient to hold the minimumCapactity and a copy of the contentsthe current buffer value, byte of the current buffer coder, int the new minimum capacity minimumCapacity)Returns the value buffer sufficient to hold the minimumCapactity and a copy of the contents. |
| pack-priv void | |
| public void | getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
Overrides default java. Copies characters from this sequence into the given destination array. |
| pack-priv final byte | |
| pack-priv final byte[] | |
| public int | |
| public int | Returns: the index of the first occurrence of the specified substring, starting at the specified index, or-1 if there is no such occurrence.the substring to search for. str, int the index from which to start the search. fromIndex)Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. |
| private static byte[] | |
| private static byte[] | Returns: the new buffer, the caller is responsible for updates to the coderthe current byte array buffer value, int the number of latin1 characters to convert to UTF16 count)Inflates the internal 8-bit latin1 storage to 16-bit <hi=0, low> pair storage. |
| pack-priv void | |
| public AbstractStringBuilder | Returns: This objectposition at which to insert subarray. index, char[] A str, int char array.the index of the first offset, int char in subarray to
be inserted.the number of len)chars in the subarray to
be inserted.Inserts the string representation of a subarray of the |
| public AbstractStringBuilder | |
| public AbstractStringBuilder | |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, char[] a character array. str)Inserts the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. dstOffset, CharSequence the sequence to be inserted s)Inserts the specified |
| public AbstractStringBuilder | Returns: a reference to this object.the offset in this sequence. dstOffset, CharSequence the sequence to be inserted. s, int the starting index of the subsequence to be inserted. start, int the end index of the subsequence to be inserted. end)Inserts a subsequence of the specified |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, boolean a b)boolean.Inserts the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, char a c)char.Inserts the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, int an i)int.Inserts the string representation of the second |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, long a l)long.Inserts the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, float a f)float.Inserts the string representation of the |
| public AbstractStringBuilder | Returns: a reference to this object.the offset. offset, double a d)double.Inserts the string representation of the |
| pack-priv final boolean | |
| private static boolean | |
| public int | Returns: the index of the last occurrence of the specified substring, or-1 if there is no such occurrence.the substring to search for. str)Returns the index within this string of the last occurrence of the specified substring. |
| public int | Returns: the index of the last occurrence of the specified substring, searching backward from the specified index, or-1 if there is no such occurrence.the substring to search for. str, int the index to start the search from. fromIndex)Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index. |
| public int | Returns: the length of the sequence of characters currently represented by this objectImplements java. Returns the length (character count). |
| private static boolean | Returns: true if the byte array should be replaced due to increased capacity or coder changea byte array value, byte old coder coder, int new capacity in characters newCapacity, byte new coder newCoder)Returns true if the byte array should be replaced due to increased capacity or coder change. |
| private static int | newCapacity(byte[]
the current buffer value, byte of the current buffer coder, int the desired minimum capacity minCapacity)Returns a capacity at least as large as the given minimum capacity. |
| public int | Returns: the index within this sequencethe index to be offset index, int the offset in code points codePointOffset)Returns the index within this sequence that is offset from the
given |
| private static byte[] | Returns: Return the buffer containing the composed string and inserted charactersbyte array destination for the string (if the coder matches) value, byte the original buffer coder coder, int the count of characters in the original buffer count, int the insertion point index, char[] char[] array to insert from s, int offset of the first character off, int the offset of the last character (exclusive) end)Returns Return the buffer containing the composed string and inserted characters. |
| private static byte[] | Returns: Return the buffer containing the composed string and inserted charactersbyte array destination for the string (if the coder matches) value, byte the original buffer coder coder, int the count of characters in the original buffer count, int the insertion point index, CharSequence CharSequence to insert from s, int offset of the first character off, int the offset of the last character (exclusive) end)Returns Return the buffer containing the composed string and inserted characters. |
| private static byte[] | Returns: the buffer with the substring insertedan existing buffer to insert into value, byte the coder of the buffer coder, int the count of characters in the buffer count, int the index to insert the string index, String the string str)Returns the buffer with the substring inserted. |
| private AbstractStringBuilder | |
| public AbstractStringBuilder | Returns: a reference to this object.code point to append codePoint, int number of times to copy count)Repeats |
| public AbstractStringBuilder | Returns: a reference to this object.a cs, int CharSequencenumber of times to copy count)Appends |
| public AbstractStringBuilder | |
| public AbstractStringBuilder | Returns: a reference to this object.Causes this character sequence to be replaced by the reverse of the sequence. |
| public void | setCharAt(int
the index of the character to modify. index, char the new character. ch)The character at the specified index is set to |
| public void | |
| private static void | |
| public CharSequence | Returns: the specified subsequence.the start index, inclusive. start, int the end index, exclusive. end)Implements java. Returns a character sequence that is a subsequence of this sequence. |
| public String | Returns: A string containing the specified subsequence of characters.The beginning index, inclusive. start)Returns a |
| public String | Returns: A string containing the specified subsequence of characters.The beginning index, inclusive. start, int The ending index, exclusive. end)Returns a |
| public abstract String | Returns: a string representation of this sequence of characters.Redeclares java. Overrides java. Returns a string representing the data in this sequence. |
| public void |