gnu.lists

Class SubCharSeq

Implemented Interfaces:
CharSeq, CharSequence, java.util.List, Consumable, java.util.List, Sequence

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, 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, eofValue

Constructor Summary

SubCharSeq(AbstractSequence base, int startPos, int endPos)

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)
CharSequence
subSequence(int start, int end)
String
toString()
void
writeTo(int start, int count, java.io.Writer dest)
Write out (part of) this string.
void
writeTo(java.io.Writer dest)

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, baseUriOfPos, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, fromEndIndex, get, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasNext, hasPrevious, hashCode, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setPosNext, setPosPrevious, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported

Constructor Details

SubCharSeq

public SubCharSeq(AbstractSequence base,
                  int startPos,
                  int endPos)

Method Details

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSeq

consume

public void consume(int start,
                    int count,
                    Consumer out)
Specified by:
consume 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

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

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

setCharAt

public void setCharAt(int index,
                      char ch)
Specified by:
setCharAt in interface CharSeq

subList

public java.util.List subList(int fromIx,
                              int toIx)
Overrides:
subList in interface AbstractSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSeq

toString

public String toString()
Specified by:
toString in interface CharSeq
Overrides:
toString in interface AbstractSequence

writeTo

public void writeTo(int start,
                    int count,
                    java.io.Writer dest)
            throws java.io.IOException
Write out (part of) this string.
Specified by:
writeTo in interface CharSeq
Parameters:
start - index of initial character to write
count - number of characters to write
dest - where to write the characters

writeTo

public void writeTo(java.io.Writer dest)
            throws java.io.IOException
Specified by:
writeTo in interface CharSeq