public class SeqPosition<E>
extends java.lang.Object
implements java.util.ListIterator<E>, java.util.Enumeration<E>
Modifier and Type | Field and Description |
---|---|
int |
ipos
An integer that (together with xpos) indicates the current position.
|
AbstractSequence<E> |
sequence
The Sequence relative to which ipos and xpos have meaning.
|
Constructor and Description |
---|
SeqPosition() |
SeqPosition(AbstractSequence<E> seq) |
SeqPosition(AbstractSequence<E> seq,
int offset,
boolean isAfter) |
SeqPosition(AbstractSequence seq,
int ipos) |
Modifier and Type | Method and Description |
---|---|
void |
add(E o) |
SeqPosition |
copy() |
void |
finalize() |
int |
fromEndIndex() |
int |
getContainingSequenceSize() |
java.lang.Object |
getNext()
Get element following current position.
|
int |
getNextKind()
Return a code (defined in Sequence) for the type of the next element.
|
java.lang.String |
getNextTypeName()
Get the "tag name" for the next element, if any.
|
E |
getNextTypeObject()
Get the "tag object" for the next element, if any.
|
int |
getPos()
Get a position int "cookie" for this SeqPosition.
|
java.lang.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.
|
E |
next()
See java.util.ListIterator.
|
E |
nextElement()
See java.util.Enumeration.
|
int |
nextIndex()
See java.util.Iterator.
|
E |
previous()
See java.util.ListIterator.
|
int |
previousIndex()
See java.util.Iterator.
|
void |
release() |
void |
remove() |
void |
set(AbstractSequence seq,
int index,
boolean isAfter) |
void |
set(E value) |
void |
set(SeqPosition pos) |
void |
setNext(E value) |
void |
setPos(AbstractSequence seq,
int ipos) |
void |
setPos(int ipos) |
void |
setPrevious(E value) |
java.lang.String |
toInfo() |
java.lang.String |
toString() |
public AbstractSequence<E> sequence
public int ipos
public SeqPosition()
public SeqPosition(AbstractSequence<E> seq)
public SeqPosition(AbstractSequence<E> seq, int offset, boolean isAfter)
public SeqPosition(AbstractSequence seq, int ipos)
public static SeqPosition make(AbstractSequence seq, int ipos)
public SeqPosition copy()
public final void gotoStart(AbstractSequence seq)
public final void gotoEnd(AbstractSequence seq)
public boolean gotoChildrenStart()
public final boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration<E>
public boolean hasNext()
public int getNextKind()
public java.lang.String getNextTypeName()
public E getNextTypeObject()
public boolean hasPrevious()
hasPrevious
in interface java.util.ListIterator<E>
public E next()
public boolean gotoNext()
public boolean gotoPrevious()
public E previous()
previous
in interface java.util.ListIterator<E>
public final E nextElement()
nextElement
in interface java.util.Enumeration<E>
public java.lang.Object getNext()
public java.lang.Object getPrevious()
public int nextIndex()
nextIndex
in interface java.util.ListIterator<E>
public final int fromEndIndex()
public int getContainingSequenceSize()
public final int previousIndex()
previousIndex
in interface java.util.ListIterator<E>
public boolean isAfter()
public void setNext(E value)
public void setPrevious(E value)
public void remove()
public int getPos()
public void setPos(AbstractSequence seq, int ipos)
public void setPos(int ipos)
public void set(AbstractSequence seq, int index, boolean isAfter)
public void set(SeqPosition pos)
public void release()
public void finalize()
finalize
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toInfo()