public class TerminatedIntIterator extends Object implements IntIterator
This data structure is generally used for a sequence of namespace codes.
Modifier and Type | Field and Description |
---|---|
(package private) int |
index |
(package private) int |
terminator |
(package private) int[] |
values |
Constructor and Description |
---|
TerminatedIntIterator(int[] values)
Construct an iterator over a sequence of integers held in an array, with
the value -1 acting as the terminator
|
TerminatedIntIterator(int[] values,
int terminator)
Construct an iterator over a sequence of integers held in an array, with
a specified value acting as the terminator
|
public TerminatedIntIterator(int[] values)
values
- the sequence of integerspublic TerminatedIntIterator(int[] values, int terminator)
values
- the sequence of integersterminator
- the terminator valuepublic boolean hasNext()
hasNext
in interface IntIterator
public int next()
next
in interface IntIterator