public class ConstMultiIntervalIterator extends Object implements Iterator<Interval>
Modifier | Constructor and Description |
---|---|
protected |
ConstMultiIntervalIterator(Iterator<Interval> iter)
Creates a new "const"-iterator using the iterator specified
for all operations except remove.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns
true if the iteration has more elements. |
Interval |
next()
Returns the next element in the iteration.
|
void |
remove()
Throws UnsupportedOperationException since this iterator does not allow modification
of the unerlying collection.
|
protected ConstMultiIntervalIterator(Iterator<Interval> iter)
iter
- the iterator to use for iteration.public boolean hasNext()
true
if the iteration has more elements.
(In other words, returns true
if next
would return
an element rather than throwing an exception.)public Interval next()
hasNext()
method returns false
will return each element
in the underlying collection exactly once.next
in interface Iterator<Interval>
NoSuchElementException
- iteration has no more elements.public void remove()
remove
in interface Iterator<Interval>
UnsupportedOperationException
- whenever called.