Package net.sf.saxon.s9api
Class XdmSequenceIterator
- java.lang.Object
-
- net.sf.saxon.s9api.XdmSequenceIterator
-
- All Implemented Interfaces:
java.util.Iterator<XdmItem>
public class XdmSequenceIterator extends java.lang.Object implements java.util.Iterator<XdmItem>
An iterator over an XPath sequence.This class implements the standard Java Iterator interface.
Because the
Iteratorinterface 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 protectedXdmSequenceIterator(SequenceIterator base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Returns true if the iteration has more elements.XdmItemnext()Returns the next element in the iteration.voidremove()Not supported on this implementation.
-
-
-
Constructor Detail
-
XdmSequenceIterator
protected XdmSequenceIterator(SequenceIterator base)
-
-
Method Detail
-
hasNext
public boolean hasNext() throws SaxonApiUncheckedExceptionReturns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)- Specified by:
hasNextin interfacejava.util.Iterator<XdmItem>- Returns:
- true if the iterator has more elements.
- Throws:
SaxonApiUncheckedException- if a dynamic error occurs during XPath evaluation that is detected at this point.
-
next
public XdmItem 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.- Specified by:
nextin interfacejava.util.Iterator<XdmItem>- Returns:
- the next element in the iteration.
- Throws:
java.util.NoSuchElementException- iteration has no more elements.
-
remove
public void remove()
Not supported on this implementation.- Specified by:
removein interfacejava.util.Iterator<XdmItem>- Throws:
java.lang.UnsupportedOperationException- always
-
-