public final class AppendableCharSequence
extends java.lang.Object
implements java.lang.CharSequence, java.lang.Appendable
| Modifier | Constructor and Description |
|---|---|
private |
AppendableCharSequence(char[] chars) |
|
AppendableCharSequence(int length) |
| Modifier and Type | Method and Description |
|---|---|
AppendableCharSequence |
append(char c) |
AppendableCharSequence |
append(java.lang.CharSequence csq) |
AppendableCharSequence |
append(java.lang.CharSequence csq,
int start,
int end) |
char |
charAt(int index) |
char |
charAtUnsafe(int index)
Access a value in this
CharSequence. |
private static char[] |
expand(char[] array,
int neededSpace,
int size) |
int |
length() |
void |
reset()
Reset the
AppendableCharSequence. |
AppendableCharSequence |
subSequence(int start,
int end) |
java.lang.String |
substring(int start,
int end)
Create a new
String from the given start to end. |
java.lang.String |
subStringUnsafe(int start,
int end)
Create a new
String from the given start to end. |
java.lang.String |
toString() |
public AppendableCharSequence(int length)
private AppendableCharSequence(char[] chars)
public int length()
length in interface java.lang.CharSequencepublic char charAt(int index)
charAt in interface java.lang.CharSequencepublic char charAtUnsafe(int index)
CharSequence.
This method is considered unsafe as index values are assumed to be legitimate.
Only underlying array bounds checking is done.index - The index to access the underlying array at.index.public AppendableCharSequence subSequence(int start, int end)
subSequence in interface java.lang.CharSequencepublic AppendableCharSequence append(char c)
append in interface java.lang.Appendablepublic AppendableCharSequence append(java.lang.CharSequence csq)
append in interface java.lang.Appendablepublic AppendableCharSequence append(java.lang.CharSequence csq, int start, int end)
append in interface java.lang.Appendablepublic void reset()
AppendableCharSequence. Be aware this will only reset the current internal position and not
shrink the internal char array.public java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic java.lang.String substring(int start,
int end)
String from the given start to end.public java.lang.String subStringUnsafe(int start,
int end)
String from the given start to end.
This method is considered unsafe as index values are assumed to be legitimate.
Only underlying array bounds checking is done.private static char[] expand(char[] array,
int neededSpace,
int size)