public abstract class TimeLimitIteration<E,X extends Exception> extends IterationWrapper<E,X>
wrappedIter
Modifier | Constructor and Description |
---|---|
protected |
TimeLimitIteration(Iteration<? extends E,? extends X> iter,
long timeLimit) |
Modifier and Type | Method and Description |
---|---|
protected void |
handleClose()
Closes this Iteration and also closes the wrapped Iteration if it is a
CloseableIteration . |
boolean |
hasNext()
Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.
|
E |
next()
Returns the next element from the wrapped Iteration.
|
void |
remove()
Removes the last element that has been returned from the wrapped Iteration.
|
protected abstract void |
throwInterruptedException()
If the iteration is interrupted by its time limit, this method is called to generate and throw the appropriate
exception.
|
close, isClosed
public boolean hasNext() throws X extends Exception
IterationWrapper
public E next() throws X extends Exception
IterationWrapper
public void remove() throws X extends Exception
IterationWrapper
protected void handleClose() throws X extends Exception
IterationWrapper
CloseableIteration
.handleClose
in class IterationWrapper<E,X extends Exception>
X
X extends Exception
Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.