public static final class MemoSequence.ProgressiveIterator extends java.lang.Object implements SequenceIterator, LastPositionFinder, GroundedIterator
Constructor and Description |
---|
ProgressiveIterator(MemoSequence container)
Create a ProgressiveIterator
|
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Get the last position (that is, the number of items in the sequence)
|
MemoSequence |
getMemoSequence()
Get the containing MemoSequence
|
GroundedValue |
getResidue()
Return a GroundedValue containing all the remaining items in the sequence returned by this
SequenceIterator, starting at the current position.
|
boolean |
isActuallyGrounded()
Ask if the iterator is actually grounded.
|
GroundedValue |
materialize()
Return a value containing all the items in the sequence returned by this
SequenceIterator
|
Item |
next()
Get the next item in the sequence.
|
boolean |
supportsGetLength()
Ask whether this iterator supports use of the
LastPositionFinder.getLength() method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, discharge
public ProgressiveIterator(MemoSequence container)
container
- the containing MemoSequencepublic MemoSequence getMemoSequence()
public Item next()
SequenceIterator
next
in interface SequenceIterator
public boolean supportsGetLength()
LastPositionFinder
LastPositionFinder.getLength()
method. This
method should always be called before calling LastPositionFinder.getLength()
, because an iterator
that implements this interface may support use of LastPositionFinder.getLength()
in some situations
and not in otherssupportsGetLength
in interface LastPositionFinder
LastPositionFinder.getLength()
method can be called to determine the length
of the underlying sequence.public int getLength()
getLength
in interface LastPositionFinder
public boolean isActuallyGrounded()
GroundedIterator
GroundedIterator.materialize()
or GroundedIterator.getResidue()
, because the iterator might
be grounded under some conditions and not others (usually when it delegates
to another iterator)isActuallyGrounded
in interface GroundedIterator
public GroundedValue materialize()
materialize
in interface GroundedIterator
public GroundedValue getResidue()
GroundedIterator
getResidue
in interface GroundedIterator
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.