| Constructor and Description |
|---|
LazySequence(SequenceIterator iterator)
Create a virtual sequence backed by an iterator
|
| Modifier and Type | Method and Description |
|---|---|
Item |
head()
Get the first item in the sequence.
|
SequenceIterator |
iterate()
Iterate over all the items in the sequence.
|
Sequence |
makeRepeatable()
Ensure that the sequence is in a form where it can be evaluated more than once.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmaterializepublic LazySequence(SequenceIterator iterator)
iterator - the iterator that delivers the items in the sequencepublic Item head() throws XPathException
head in interface SequenceXPathException - if an error occurs evaluating the underlying expressionpublic SequenceIterator iterate() throws XPathException
iterate in interface SequenceXPathException - if evaluation of the iterator fails.java.lang.IllegalStateException - if iterate() has already been calledpublic Sequence makeRepeatable() throws XPathException
SequenceLazySequence and Closure can only be evaluated
once, and this operation causes these to be grounded. However, making it repeatable
is not the same as making it grounded; it does not flush out all errors. Indeed, lazy
evaluation relies on this property, because an expression that has been lifted out of
a loop must not be evaluated unless the loop is executed at least once, to prevent spurious
errors.makeRepeatable in interface SequenceXPathException - if evaluation failsCopyright (c) 2004-2020 Saxonica Limited.