Package net.sf.saxon.tree.jiter
Class IterableSequenceIterator<T extends Item>
java.lang.Object
net.sf.saxon.tree.jiter.IterableSequenceIterator<T>
- Type Parameters:
T- The type of items returned. It is the caller's responsibility to ensure that the supplied SequenceIterator returns items of the correct type.
public class IterableSequenceIterator<T extends Item>
extends Object
implements Iterable<T>, Iterator<T>
Wraps a SequenceIterator in a Java iterable, allowing the convenience of
processing the items in a Java for-each loop. The iterable can only be used
once: it implements both
Iterable<T> and Iterator<T>, and
throws an exception if the iterator() method is called more than once.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
IterableSequenceIterator
Create a wrapping iterator- Parameters:
in- the input iterator
-
-
Method Details
-
iterator
Returns an iterator over elements of typeT. -
hasNext
public boolean hasNext()Returnstrueif the iteration has more elements. -
next
Returns the next element in the iteration.
-