public class IterationWrapper<E,X extends Exception> extends CloseableIterationBase<E,X>
| Modifier and Type | Field and Description |
|---|---|
protected Iteration<? extends E,? extends X> |
wrappedIter
The wrapped Iteration.
|
| Constructor and Description |
|---|
IterationWrapper(Iteration<? extends E,? extends X> iter)
Creates a new IterationWrapper that operates on the supplied Iteration.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleClose()
Closed 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.
|
close, isClosedpublic boolean hasNext()
throws X extends Exception
public E next() throws X extends Exception
NoSuchElementException - If all elements have been returned.IllegalStateException - If the Iteration has been closed.X extends Exceptionpublic void remove()
throws X extends Exception
UnsupportedOperationException - If the wrapped Iteration does not support the remove
operation.IllegalStateException - if the Iteration has been closed, or if next() has not yet
been called, or remove() has already been called after the
last call to next().X extends Exceptionprotected void handleClose()
throws X extends Exception
CloseableIteration.handleClose in class CloseableIterationBase<E,X extends Exception>XX extends ExceptionCopyright © 2001-2014 Aduna. All Rights Reserved.