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 CharSequence
s.
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 Appendable
public Appendable append(CharSequence csq, int start, int end)
append
in interface Appendable
public Appendable append(char c)
append(CharSequence)
.append
in interface Appendable
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public Iterator<CharSequence> iterator()
iterator
in interface Iterable<CharSequence>
public String toString()
toString
in interface CharSequence
toString
in class Object
public void writeTo(Appendable out) throws IOException
writeTo
in interface CharSequenceBuffer
IOException
Copyright © 2015. All Rights Reserved.