Package net.sf.saxon.sort
Class TerminatedIntIterator
- java.lang.Object
-
- net.sf.saxon.sort.TerminatedIntIterator
-
- All Implemented Interfaces:
IntIterator
public class TerminatedIntIterator extends java.lang.Object implements IntIterator
An iterator over a sequence of integers held in an array. The array may either be exactly the right size, or may be terminated by an end-of-sequence value.This data structure is generally used for a sequence of namespace codes.
-
-
Constructor Summary
Constructors Constructor Description TerminatedIntIterator(int[] values)
Construct an iterator over a sequence of integers held in an array, with the value -1 acting as the terminatorTerminatedIntIterator(int[] values, int terminator)
Construct an iterator over a sequence of integers held in an array, with a specified value acting as the terminator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test whether there are any more integers in the sequenceint
next()
Return the next integer in the sequence.
-
-
-
Constructor Detail
-
TerminatedIntIterator
public TerminatedIntIterator(int[] values)
Construct an iterator over a sequence of integers held in an array, with the value -1 acting as the terminator- Parameters:
values
- the sequence of integers
-
TerminatedIntIterator
public 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- Parameters:
values
- the sequence of integersterminator
- the terminator value
-
-
Method Detail
-
hasNext
public boolean hasNext()
Test whether there are any more integers in the sequence- Specified by:
hasNext
in interfaceIntIterator
- Returns:
- true if there are more integers to come
-
next
public int next()
Return the next integer in the sequence. The result is undefined unless hasNext() has been called and has returned true.- Specified by:
next
in interfaceIntIterator
- Returns:
- the next integer in the sequence
-
-