public class TerminatedIntIterator extends java.lang.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 IntIteratorpublic int next()
next in interface IntIterator