gnu.lists
public class SeqPosition extends Object implements ListIterator, Enumeration
| Field Summary | |
|---|---|
| int | ipos
An integer that (together with xpos) indicates the current position.
|
| AbstractSequence | sequence
The Sequence relative to which ipos and xpos have meaning.
|
| Constructor Summary | |
|---|---|
| SeqPosition() | |
| SeqPosition(AbstractSequence seq) | |
| SeqPosition(AbstractSequence seq, int offset, boolean isAfter) | |
| SeqPosition(AbstractSequence seq, int ipos) | |
| Method Summary | |
|---|---|
| void | add(Object o) |
| SeqPosition | copy() |
| void | finalize() |
| int | fromEndIndex() |
| int | getContainingSequenceSize() |
| Object | getNext()
Get element following current position.
|
| int | getNextKind() Return a code (defined in Sequence) for the type of the next element. |
| String | getNextTypeName() Get the "tag name" for the next element, if any. |
| Object | getNextTypeObject() Get the "tag object" for the next element, if any. |
| int | getPos() Get a position int "cookie" for this SeqPosition.
|
| Object | getPrevious()
Get element before the current position.
|
| boolean | gotoChildrenStart() Set position before first child (of the element following position). |
| void | gotoEnd(AbstractSequence seq) |
| boolean | gotoNext() Move one element forwards, if possible. |
| boolean | gotoPrevious() Move backwards one element. |
| void | gotoStart(AbstractSequence seq) |
| boolean | hasMoreElements() True if there is an element following the current position.
|
| boolean | hasNext() See java.util.Iterator. |
| boolean | hasPrevious() See java.util.Iterator. |
| boolean | isAfter() Tests whether the position pair has the "isAfter" property.
|
| static SeqPosition | make(AbstractSequence seq, int ipos) Creates a new SeqPosition, from a position pair.
|
| Object | next() See java.util.ListIterator. |
| Object | nextElement() See java.util.Enumeration. |
| int | nextIndex() See java.util.Iterator. |
| Object | previous() See java.util.ListIterator. |
| int | previousIndex() See java.util.Iterator. |
| void | release() |
| void | remove() |
| void | set(Object value) |
| void | set(AbstractSequence seq, int index, boolean isAfter) |
| void | set(SeqPosition pos) |
| void | setNext(Object value) |
| void | setPos(AbstractSequence seq, int ipos) |
| void | setPos(int ipos) |
| void | setPrevious(Object value) |
| String | toInfo() |
| String | toString() |
Returns: EOF if at end of sequence, otherwise the value following.
Returns: EOF if at beginning of sequence, otherwise the value prior.
Returns: true if there is a child sequence (which might be empty); false if current position is end of sequence or following element is atomic (cannot have children).
Returns: if we succeeded in moving forwards (i.e. not at end of sequence).
Returns: false iff already at beginning.