Package net.sf.saxon.z
Interface IntIterator
-
- All Known Implementing Classes:
ConcatenatingIntIterator
,EmptyIntIterator
,IntArraySet.IntArrayIterator
,IntRepeatIterator
,IntSingletonIterator
,IntStepIterator
,Operation.ForceProgressIterator
public interface IntIterator
An iterator over a sequence of unboxed int values.Note that although
IntIterator
uses the same method names asIterator
, the contract is different. The behavior of the iterator is well defined if each call onnext()
is preceded by exactly one call onhasNext()
(and that call must have returnedtrue
); in all other cases the result is unpredictable. So unlikeIterator
, bothhasNext()
andnext()
are allowed to advance the position of the iterator.
-
-
Method Summary
All Methods Instance Methods Abstract 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 onnext()
delivers the next integer.int
next()
Return the next integer in the sequence.
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Test whether there are any more integers in the sequence; and change the state of the iterator so a call onnext()
delivers the next integer.The effect of calling
#hasNext()
a second time without an intervening call on#next()
is undefined.- Returns:
- true if there are more integers to come
-
next
int next()
Return the next integer in the sequence. The result is undefined unless#hasNext()
has been called and has returned true.- Returns:
- the next integer in the sequence
-
-