Package net.sf.saxon.z
Class ConcatenatingIntIterator
- java.lang.Object
-
- net.sf.saxon.z.ConcatenatingIntIterator
-
- All Implemented Interfaces:
IntIterator
public class ConcatenatingIntIterator extends java.lang.Object implements IntIterator
An iterator over nodes, that concatenates the nodes returned by two supplied iterators.
-
-
Constructor Summary
Constructors Constructor Description ConcatenatingIntIterator(IntIterator first, java.util.function.Supplier<IntIterator> second)
Create an iterator that concatenates the results of two supplied iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test whether there are any more integers in the sequence; and change the state of the iterator so a call onIntIterator.next()
delivers the next integer.int
next()
Get the next item in the sequence.
-
-
-
Constructor Detail
-
ConcatenatingIntIterator
public ConcatenatingIntIterator(IntIterator first, java.util.function.Supplier<IntIterator> second)
Create an iterator that concatenates the results of two supplied iterator. The second iterator isn't created until it is actually needed.- Parameters:
first
- the first iteratorsecond
- a function that can be called to supply the second iterator
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:IntIterator
Test whether there are any more integers in the sequence; and change the state of the iterator so a call onIntIterator.next()
delivers the next integer.The effect of calling
#hasNext()
a second time without an intervening call on#next()
is undefined.- Specified by:
hasNext
in interfaceIntIterator
- Returns:
- true if there are more integers to come
-
next
public int next()
Get the next item in the sequence.- Specified by:
next
in interfaceIntIterator
- Returns:
- the next Item. If there are no more items, return null.
-
-