public interface GroundedIterator extends SequenceIterator
We stretch the concept to consider an iterator over a MemoClosure as a grounded iterator, on the basis that the in-memory sequence might exist already or might be created as a side-effect of navigating the iterator. This is why materializing the iterator can raise an exception.
Modifier and Type | Method and Description |
---|---|
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.
|
default GroundedValue |
materialize()
Create a GroundedValue (a sequence materialized in memory) containing all the values delivered
by this SequenceIterator.
|
close, discharge, next
boolean isActuallyGrounded()
materialize()
or getResidue()
, because the iterator might
be grounded under some conditions and not others (usually when it delegates
to another iterator)GroundedValue getResidue()
UncheckedXPathException
- in the cases of subclasses (such as the iterator over a MemoClosure)
which cause evaluation of expressions while materializing the value.default GroundedValue materialize()
It is implementation-dependant whether this method consumes the SequenceIterator. (More specifically,
in the current implementation: if the iterator is backed by a GroundedValue
, then that
value is returned and the iterator is not consumed; otherwise, the iterator is consumed and the
method returns the remaining items after the current position only).
UncheckedXPathException
- if reading the SequenceIterator throws an errorCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.