public class CharSequenceList extends Object implements CharSequenceBuffer
Appendable buffer of character data,similar to StringBuilder and
StringBuffer), except rather than copying the contents to an array of characters,
it keeps a list of references to the original CharSequences.
This offers a few advantages:
With these advantages, come some disadvantages:
writeTo(Appendable)
instead.| Constructor and Description |
|---|
CharSequenceList() |
| Modifier and Type | Method and Description |
|---|---|
Appendable |
append(char c)
Warning: Each time this method is called, a new String of length 1 is constructed
and added to a LinkedList - this is not optimal.
|
Appendable |
append(CharSequence csq) |
Appendable |
append(CharSequence csq,
int start,
int end) |
char |
charAt(int index) |
Iterator<CharSequence> |
iterator() |
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
void |
writeTo(Appendable out) |
public Appendable append(CharSequence csq)
append in interface Appendablepublic Appendable append(CharSequence csq, int start, int end)
append in interface Appendablepublic Appendable append(char c)
append(CharSequence).append in interface Appendablepublic int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic Iterator<CharSequence> iterator()
iterator in interface Iterable<CharSequence>public String toString()
toString in interface CharSequencetoString in class Objectpublic void writeTo(Appendable out) throws IOException
writeTo in interface CharSequenceBufferIOExceptionCopyright © 2015. All Rights Reserved.