gnu.lists
Class SubSequence
- java.util.List, Consumable, Sequence
A sequence consisting of a sub-range of the elements of a base sequence.
The start and end positions are positions triples (on the same sequence).
ATTRIBUTE_VALUE , BOOLEAN_VALUE , CDATA_VALUE , CHAR_VALUE , COMMENT_VALUE , DOCUMENT_VALUE , DOUBLE_VALUE , ELEMENT_VALUE , EOF_VALUE , FLOAT_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 |
void | clear()
|
int | compare(int ipos1, int ipos2) - Compare two positions, and indicate their relative order.
|
int | createPos(int offset, boolean isAfter) - Generate a position at a given index.
|
int | createRelativePos(int pos, int offset, boolean isAfter)
|
void | finalize()
|
Object | get(int index) - See java.util.List.
|
protected int | getIndexDifference(int ipos1, int ipos0) - Get offset of (ipos1) relative to (ipos0).
|
int | getNextKind(int ipos)
|
Object | getPosNext(int ipos) - Get the element following the specified position.
|
Object | getPosPrevious(int ipos) - Get the element before the specified position.
|
protected boolean | isAfterPos(int ipos) - Tests whether the position has the "isAfter" property.
|
protected int | nextIndex(int ipos) - Get the offset from the beginning corresponding to a position cookie.
|
void | releasePos(int ipos) - Reclaim any resources used by the given position int.
|
void | removePosRange(int istart, int iend) - Remove a range where each end-point is a position in a container.
|
int | size() - See java.util.List.
|
add , add , addAll , addAll , addPos , clear , compare , compare , compare , consume , consumeNext , consumePosRange , contains , containsAll , copyPos , createPos , createRelativePos , elements , endPos , equals , equals , fill , fill , fillPosRange , firstAttributePos , firstChildPos , 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 , unsupportedException |
SubSequence
public SubSequence()
compare
public int compare(int ipos1,
int ipos2)
Compare two positions, and indicate their relative order.
- compare in interface AbstractSequence
createPos
public int createPos(int offset,
boolean isAfter)
Generate a position at a given index.
The result is a position cookie that must be free'd with releasePos.
- createPos in interface AbstractSequence
isAfter
- should the position have the isAfter property
finalize
public void finalize()
getPosNext
public Object getPosNext(int ipos)
Get the element following the specified position.
- getPosNext in interface AbstractSequence
ipos
- the specified position.
- the following element, or eofValue if there is none.
Called by SeqPosition.getNext.
getPosPrevious
public Object getPosPrevious(int ipos)
Get the element before the specified position.
- getPosPrevious in interface AbstractSequence
ipos
- the specified position.
- the following element, or eofValue if there is none.
isAfterPos
protected boolean isAfterPos(int ipos)
Tests whether the position has the "isAfter" property.
I.e. if something is inserted at the position, will
the iterator end up being after the new data?
- isAfterPos in interface AbstractSequence
nextIndex
protected int nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
- nextIndex in interface AbstractSequence
releasePos
public void releasePos(int ipos)
Reclaim any resources used by the given position int.
- releasePos in interface AbstractSequence
ipos
- the Pos being free'd.
removePosRange
public void removePosRange(int istart,
int iend)
Remove a range where each end-point is a position in a container.
- removePosRange in interface AbstractSequence