Class XdmSequenceIterator

  extended by net.sf.saxon.s9api.XdmSequenceIterator
All Implemented Interfaces:

public class XdmSequenceIterator
extends Object
implements Iterator<XdmItem>

An iterator over an XPath sequence.

This class implements the standard Java Iterator interface.

Because the Iterator interface does not define any checked exceptions, the hasNext() 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
protected XdmSequenceIterator(SequenceIterator base)
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 XdmItem next()
          Returns the next element in the iteration.
 void remove()
          Not supported on this implementation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


protected XdmSequenceIterator(SequenceIterator base)
Method Detail


public boolean hasNext()
                throws SaxonApiUncheckedException
Returns 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:
hasNext in interface Iterator<XdmItem>
true if the iterator has more elements.
SaxonApiUncheckedException - if a dynamic error occurs during XPath evaluation that is detected at this point.


public XdmItem next()
Returns the next element in the iteration. Calling this method repeatedly until the hasNext() method returns false will return each element in the underlying collection exactly once.

Specified by:
next in interface Iterator<XdmItem>
the next element in the iteration.
NoSuchElementException - iteration has no more elements.


public void remove()
Not supported on this implementation.

Specified by:
remove in interface Iterator<XdmItem>
UnsupportedOperationException - always

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.