public class MemoSequence<T extends Item<?>> extends java.lang.Object implements Sequence<T>
Modifier and Type | Class and Description |
---|---|
class |
MemoSequence.ProgressiveIterator
A ProgressiveIterator starts by reading any items already held in the reservoir;
when the reservoir is exhausted, it reads further items from the inputIterator,
copying them into the reservoir as they are read.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
EMPTY |
protected int |
state |
Constructor and Description |
---|
MemoSequence(SequenceIterator<T> iterator) |
Modifier and Type | Method and Description |
---|---|
T |
head()
Get the first item in the sequence.
|
Item |
itemAt(int n)
Get the Nth item in the sequence (0-based), reading new items into the internal reservoir if necessary
|
SequenceIterator<T> |
iterate()
Get a
SequenceIterator over all the items in the sequence |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asIterable, makeRepeatable, materialize
protected int state
protected static final int EMPTY
public MemoSequence(SequenceIterator<T> iterator)
public T head() throws XPathException
Sequence
head
in interface Sequence<T extends Item<?>>
XPathException
- in the situation where the sequence is evaluated lazily, and
evaluation of the first item causes a dynamic error.public SequenceIterator<T> iterate() throws XPathException
Sequence
SequenceIterator
over all the items in the sequenceiterate
in interface Sequence<T extends Item<?>>
SequenceIterator
, which is
not a Iterator
) over all the itemsXPathException
- in the situation where the sequence is evaluated lazily, and
constructing an iterator over the items causes a dynamic error.public Item itemAt(int n) throws XPathException
n
- the index of the required itemXPathException
- if the input sequence cannot be readCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.