| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Object | appendableField
Field applied when Appendable methods are used. |
| pack-priv int | appendOffset
Number of characters from the end where .append() operations insert. |
| pack-priv char[] | |
| public static final FormattedStringBuilder | EMPTY
A constant, empty FormattedStringBuilder. |
| pack-priv Object[] | |
| private static final Map | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of chars added, which is the length of CharSequence.Appends the specified CharSequence to the end of the string. |
| public int | |
| public int | Returns: The number of chars added, which is the length of the otherFormattedStringBuilder.Appends the contents of another |
| public Appendable | append(CharSequence
The character sequence to append. If csq)csq is
null, then the four characters "null" are
appended to this Appendable.Implements java. |
| public Appendable | append(CharSequence
The character sequence from which a subsequence will be
appended. If csq, int csq is null, then characters
will be appended as if csq contained the four
characters "null".The index of the first character in the subsequence start, int The index of the character following the last character in the
subsequence end)Implements java. |
| public Appendable | append(char
The character to append c)Implements java. |
| public int | |
| public int | Returns: The number of chars added: 1 if the code point is in the BMP, or 2 otherwise.Appends the specified codePoint to the end of the string. |
| public char | charAt(int
the index of the index)char value to be returnedImplements java. char value at the specified index.
|
| public FormattedStringBuilder | |
| public int | |
| public int | |
| public int | |
| public boolean | Returns: Whether the contents and field values of this string builder are equal to the given chars and fields.
|
| public boolean | Returns: Whether the contents of this instance is currently equal to the given instance.The instance to compare. other)
|
| public void | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public Object | |
| private int | |
| public int | |
| public int | |
| public int | |
| public int | Returns: The number of chars added, which is the length of CharSequence.Inserts the specified CharSequence at the specified index in the string. |
| public int | Returns: The number of chars added, which is the length of CharSequence.Inserts the specified CharSequence at the specified index in the string, reading from the CharSequence from start (inclusive) to end (exclusive). |
| public int | Returns: The number of chars added, which is the length of the char array.Inserts the chars in the specified char array at the specified index in the string, and associates them with the fields in the specified field array, which must have the same length as chars. |
| public int | Returns: The number of chars added, which is the length of the otherFormattedStringBuilder.Inserts the contents of another |
| public int | |
| public int | Returns: The number of chars added: 1 if the code point is in the BMP, or 2 otherwise.Inserts the specified codePoint at the specified index in the string. |
| public int | |
| private int | Returns: The position in the char array to insert the chars.The location in the string where the operation is to take place. index, int The number of chars (UTF-16 code units) to be inserted at that location. count)Shifts around existing data if necessary to make room for new characters. |
| private int | |
| private int | |
| public void | setAppendableField(Object
The field used when inserting strings. field)Call this method before using any of the Appendable overrides. |
| public void | setAppendIndex(int
The index at which append operations should insert. index)Sets the index at which append operations insert. |
| public int | Returns: The number of chars added, which may be negative if the removed segment is longer than the length of the CharSequence segment that was inserted.Replaces the chars between startThis and endThis with the chars between startOther and endOther of the given CharSequence. |
| public CharSequence | subSequence(int
the start index, inclusive start, int the end index, exclusive end)Implements java.
Deprecated
Note this returns a FormattedStringBuilder. |
| public String | |
| public char[] | |
| public String | Returns: A string for debugging purposes.Returns a string that includes field information, for debugging purposes. |
| public Object[] | |
| public String | toString()
Overrides java. Implements java. |
| public static Format. |
| appendableField | back to summary |
|---|---|
| pack-priv Object appendableField Field applied when Appendable methods are used. | |
| appendOffset | back to summary |
|---|---|
| pack-priv int appendOffset Number of characters from the end where .append() operations insert. | |
| chars | back to summary |
|---|---|
| pack-priv char[] chars | |
| EMPTY | back to summary |
|---|---|
| public static final FormattedStringBuilder EMPTY A constant, empty FormattedStringBuilder. Do NOT call mutative operations on this. | |
| fields | back to summary |
|---|---|
| pack-priv Object[] fields | |
| fieldToDebugChar | back to summary |
|---|---|
| private static final Map<Object, Character> fieldToDebugChar | |
| length | back to summary |
|---|---|
| pack-priv int length | |
| zero | back to summary |
|---|---|
| pack-priv int zero | |
| FormattedStringBuilder | back to summary |
|---|---|
| public FormattedStringBuilder() | |
| FormattedStringBuilder | back to summary |
|---|---|
| public FormattedStringBuilder(int capacity) | |
| FormattedStringBuilder | back to summary |
|---|---|
| public FormattedStringBuilder(FormattedStringBuilder source) | |
| append | back to summary |
|---|---|
| public int append(CharSequence sequence, Object field) Appends the specified CharSequence to the end of the string.
| |
| append | back to summary |
|---|---|
| public int append(char[] chars, Object[] fields) Appends the chars in the specified char array to the end of the string, and associates them with the fields in the specified field array, which must have the same length as chars.
| |
| append | back to summary |
|---|---|
| public int append(FormattedStringBuilder other) Appends the contents of another
| |
| append | back to summary |
|---|---|
| public Appendable append(CharSequence csq) Implements java. This method is provided for Java Appendable compatibility. In most cases, please use the append methods that take
a Field parameter. If you do use this method, you must call
| |
| append | back to summary |
|---|---|
| public Appendable append(CharSequence csq, int start, int end) Implements java. This method is provided for Java Appendable compatibility. In most cases, please use the append methods that take
a Field parameter. If you do use this method, you must call
| |
| append | back to summary |
|---|---|
| public Appendable append(char c) Implements java. This method is provided for Java Appendable compatibility. In most cases, please use the append methods that take
a Field parameter. If you do use this method, you must call
| |
| appendChar16 | back to summary |
|---|---|
| public int appendChar16(char codeUnit, Object field) | |
| appendCodePoint | back to summary |
|---|---|
| public int appendCodePoint(int codePoint, Object field) Appends the specified codePoint to the end of the string.
| |
| charAt | back to summary |
|---|---|
| public char charAt(int index) Implements java. Doc from java. Returns the If the
| |
| clear | back to summary |
|---|---|
| public FormattedStringBuilder clear() | |
| codePointAt | back to summary |
|---|---|
| public int codePointAt(int index) | |
| codePointBefore | back to summary |
|---|---|
| public int codePointBefore(int index) | |
| codePointCount | back to summary |
|---|---|
| public int codePointCount() | |
| contentEquals | back to summary |
|---|---|
public boolean contentEquals(char[] chars, Object[] fields)
| |
| contentEquals | back to summary |
|---|---|
public boolean contentEquals(FormattedStringBuilder other)
| |
| copyFrom | back to summary |
|---|---|
| public void copyFrom(FormattedStringBuilder source) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| fieldAt | back to summary |
|---|---|
| public Object fieldAt(int index) | |
| getCapacity | back to summary |
|---|---|
| private int getCapacity() | |
| getFirstCodePoint | back to summary |
|---|---|
| public int getFirstCodePoint() | |
| getLastCodePoint | back to summary |
|---|---|
| public int getLastCodePoint() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| insert | back to summary |
|---|---|
| public int insert(int index, CharSequence sequence, Object field) Inserts the specified CharSequence at the specified index in the string.
| |
| insert | back to summary |
|---|---|
| public int insert(int index, CharSequence sequence, int start, int end, Object field) Inserts the specified CharSequence at the specified index in the string, reading from the CharSequence from start (inclusive) to end (exclusive).
| |
| insert | back to summary |
|---|---|
| public int insert(int index, char[] chars, Object[] fields) Inserts the chars in the specified char array at the specified index in the string, and associates them with the fields in the specified field array, which must have the same length as chars.
| |
| insert | back to summary |
|---|---|
| public int insert(int index, FormattedStringBuilder other) Inserts the contents of another
| |
| insertChar16 | back to summary |
|---|---|
| public int insertChar16(int index, char codeUnit, Object field) | |
| insertCodePoint | back to summary |
|---|---|
| public int insertCodePoint(int index, int codePoint, Object field) Inserts the specified codePoint at the specified index in the string.
| |
| length | back to summary |
|---|---|
| public int length() Implements java. Doc from java. Returns the length of this character sequence. The length is the number
of 16-bit
| |
| prepareForInsert | back to summary |
|---|---|
| private int prepareForInsert(int index, int count) Shifts around existing data if necessary to make room for new characters.
| |
| prepareForInsertHelper | back to summary |
|---|---|
| private int prepareForInsertHelper(int index, int count) | |
| remove | back to summary |
|---|---|
| private int remove(int index, int count) Removes the "count" chars starting at "index". Returns the position at which the chars were removed. | |
| setAppendableField | back to summary |
|---|---|
| public void setAppendableField(Object field) Call this method before using any of the Appendable overrides.
| |
| setAppendIndex | back to summary |
|---|---|
| public void setAppendIndex(int index) Sets the index at which append operations insert. Defaults to the end.
| |
| splice | back to summary |
|---|---|
| public int splice(int startThis, int endThis, CharSequence sequence, int startOther, int endOther, Object field) Replaces the chars between startThis and endThis with the chars between startOther and endOther of the given CharSequence. Calling this method with startThis == endThis is equivalent to calling insert.
| |
| subSequence | back to summary |
|---|---|
| public CharSequence subSequence(int start, int end) Implements java. Deprecated
Note this returns a FormattedStringBuilder. Do not return publicly.
| |
| subString | back to summary |
|---|---|
| public String subString(int start, int end) Use this instead of subSequence if returning publicly. | |
| toCharArray | back to summary |
|---|---|
public char[] toCharArray()
| |
| toDebugString | back to summary |
|---|---|
| public String toDebugString() Returns a string that includes field information, for debugging purposes. For example, if the string is "-12.345", the debug string will be something like "<FormattedStringBuilder [-123.45] [-iii.ff]>"
| |
| toFieldArray | back to summary |
|---|---|
public Object[] toFieldArray()
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Returns the string represented by the characters in this string builder.
For a string intended be used for debugging, use
| |
| unwrapField | back to summary |
|---|---|
| public static Format. | |
| unwrap | back to summary |
|---|---|
| public Format. | |