public interface IntIterator
Note that although
IntIterator uses the same method names as
the contract is different. The behavior of the iterator is well defined if each call on
next() is preceded by exactly one call on
hasNext() (and that call
must have returned
true); in all other cases the result is unpredictable. So unlike
next() are allowed
to advance the position of the iterator.
|Modifier and Type||Method and Description|
Test whether there are any more integers in the sequence; and change the state of the iterator so a call on
Return the next integer in the sequence.
next()delivers the next integer.
The effect of calling
#hasNext() a second time without an intervening
#next() is undefined.
#hasNext()has been called and has returned true.
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.