Package net.sf.saxon.s9api
Class XdmSequenceIterator<T extends XdmItem>
- java.lang.Object
-
- net.sf.saxon.s9api.XdmSequenceIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
public class XdmSequenceIterator<T extends XdmItem> extends java.lang.Object implements java.util.Iterator<T>
An iterator over an XPath sequence.This class implements the standard Java Iterator interface.
Because the
Iterator
interface does not define any checked exceptions, thehasNext()
method of this iterator throws an unchecked exception if a dynamic error occurs while evaluating the expression. Applications wishing to control error handling should take care to catch this exception.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
XdmSequenceIterator(SequenceIterator base)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
The close() method should be called to release resources if the caller wants to stop reading data before reaching the end.boolean
hasNext()
Returns true if the iteration has more elements.T
next()
Returns the next element in the iteration.static XdmSequenceIterator<XdmAtomicValue>
ofAtomicValues(SequenceIterator base)
protected static XdmSequenceIterator<XdmNode>
ofNode(XdmNode node)
static XdmSequenceIterator<XdmNode>
ofNodes(AxisIterator base)
void
remove()
Not supported on this implementation.XdmStream<T>
stream()
Convert this iterator to a Stream
-
-
-
Constructor Detail
-
XdmSequenceIterator
protected XdmSequenceIterator(SequenceIterator base)
-
-
Method Detail
-
ofNodes
public static XdmSequenceIterator<XdmNode> ofNodes(AxisIterator base)
-
ofAtomicValues
public static XdmSequenceIterator<XdmAtomicValue> ofAtomicValues(SequenceIterator base)
-
ofNode
protected static XdmSequenceIterator<XdmNode> ofNode(XdmNode node)
-
hasNext
public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
-
next
public T next()
Returns the next element in the iteration. Calling this method repeatedly until thehasNext()
method returns false will return each element in the underlying collection exactly once.
-
remove
public void remove()
Not supported on this implementation.
-
close
public void close()
The close() method should be called to release resources if the caller wants to stop reading data before reaching the end. This is particularly relevant if the query uses saxon:stream() to read its input, since there will then be another thread supplying data, which will be left in suspended animation if no-one is consuming the data.- Since:
- 9.5.1.5 (see bug 2016)
-
-