gnu.lists
Class SubCharSeq
java.lang.Object
gnu.lists.AbstractSequence
gnu.lists.SubSequence
gnu.lists.SubCharSeq
- All Implemented Interfaces:
- CharSeq, Consumable, Sequence, java.lang.CharSequence, java.lang.Iterable, java.util.Collection, java.util.List
public class SubCharSeq
- extends SubSequence
- implements CharSeq
Fields inherited from interface gnu.lists.Sequence |
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, GROUP_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE |
Method Summary |
char |
charAt(int index)
|
void |
consume(int start,
int count,
Consumer out)
|
void |
fill(char value)
Set all the elements to a given character. |
void |
fill(int fromIndex,
int toIndex,
char value)
|
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
Copy characters into a destination buffer. |
int |
length()
Get length of string, in characters. |
void |
setCharAt(int index,
char ch)
|
java.util.List |
subList(int fromIx,
int toIx)
|
java.lang.CharSequence |
subSequence(int start,
int end)
|
java.lang.String |
toString()
|
void |
writeTo(java.lang.Appendable dest)
|
void |
writeTo(int start,
int count,
java.lang.Appendable dest)
Append a specified subsequence to an Appendable . |
Methods inherited from class gnu.lists.SubSequence |
clear, compare, createPos, createRelativePos, finalize, get, getIndexDifference, getNextKind, getPosNext, getPosPrevious, isAfterPos, nextIndex, releasePos, removePosRange, size |
Methods inherited from class gnu.lists.AbstractSequence |
add, add, addAll, addAll, addPos, append, append, append, baseUriOfPos, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, remove, remove, removeAll, removePos, retainAll, set, set, setPosNext, setPosPrevious, stableCompare, startPos, subSequence, subSequencePos, toArray, toArray, toString, unsupported |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, toArray, toArray |
SubCharSeq
public SubCharSeq(AbstractSequence base,
int startPos,
int endPos)
length
public int length()
- Get length of string, in characters.
Synonym for size(), for compatibility with String and StringBuffer.
- Specified by:
length
in interface CharSeq
- Specified by:
length
in interface java.lang.CharSequence
charAt
public char charAt(int index)
- Specified by:
charAt
in interface CharSeq
- Specified by:
charAt
in interface java.lang.CharSequence
getChars
public void getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
- Copy characters into a destination buffer.
Same interface as java.lang.String's getChars.
- Specified by:
getChars
in interface CharSeq
setCharAt
public void setCharAt(int index,
char ch)
- Specified by:
setCharAt
in interface CharSeq
fill
public void fill(char value)
- Set all the elements to a given character.
- Specified by:
fill
in interface CharSeq
fill
public void fill(int fromIndex,
int toIndex,
char value)
- Specified by:
fill
in interface CharSeq
writeTo
public void writeTo(int start,
int count,
java.lang.Appendable dest)
throws java.io.IOException
- Description copied from interface:
CharSeq
- Append a specified subsequence to an
Appendable
.
An allowable implementation is:
dest.append(this, start, start+count)
.
Hence implementors of Appendable
should avoid calling
writeTo
- though they can call getChars
.
- Specified by:
writeTo
in interface CharSeq
- Throws:
java.io.IOException
writeTo
public void writeTo(java.lang.Appendable dest)
throws java.io.IOException
- Specified by:
writeTo
in interface CharSeq
- Throws:
java.io.IOException
consume
public void consume(int start,
int count,
Consumer out)
- Specified by:
consume
in interface CharSeq
toString
public java.lang.String toString()
- Specified by:
toString
in interface CharSeq
- Specified by:
toString
in interface java.lang.CharSequence
- Overrides:
toString
in class AbstractSequence
subList
public java.util.List subList(int fromIx,
int toIx)
- Specified by:
subList
in interface java.util.List
- Overrides:
subList
in class AbstractSequence
subSequence
public java.lang.CharSequence subSequence(int start,
int end)
- Specified by:
subSequence
in interface CharSeq
- Specified by:
subSequence
in interface java.lang.CharSequence