public abstract class ExceptionConvertingIteration<E,X extends Exception> extends CloseableIterationBase<E,X>
convert(Exception) to do the conversion.| Constructor and Description |
|---|
ExceptionConvertingIteration(Iteration<? extends E,? extends Exception> iter)
Creates a new ExceptionConvertingIteration that operates on the supplied
iteration.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract X |
convert(Exception e)
Converts an exception from the underlying iteration to an exception of
type X.
|
protected void |
handleClose()
Closes this Iteration as well as the wrapped Iteration if it happens to be
a
CloseableIteration. |
boolean |
hasNext()
Checks whether the underlying Iteration contains more elements.
|
E |
next()
Returns the next element from the wrapped Iteration.
|
void |
remove()
Calls remove() on the underlying Iteration.
|
close, isClosedprotected abstract X convert(Exception e)
public boolean hasNext()
throws X extends Exception
public E next() throws X extends Exception
XNoSuchElementException - 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-2013 Aduna. All Rights Reserved.