|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.ExceptionConvertingIteration<E,X>
public abstract class ExceptionConvertingIteration<E,X extends Exception>
A CloseableIteration that converts an arbitrary iteration to an iteration
with exceptions of type X. Subclasses need to override
convert(Exception) to do the conversion.
| Field Summary |
|---|
| Fields inherited from class info.aduna.iteration.CloseableIterationBase |
|---|
logger |
| Constructor Summary | |
|---|---|
ExceptionConvertingIteration(Iteration<? extends E,? extends Exception> iter)
Creates a new ExceptionConvertingIteration that operates on the supplied iteration. |
|
| Method Summary | |
|---|---|
protected X |
convert(Exception e)
Converts an exception from the underlying iteration to an exception of type X. |
protected X |
convertedException(Exception e)
Deprecated. convert(Exception) should be used or overridden
instead. |
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. |
| Methods inherited from class info.aduna.iteration.CloseableIterationBase |
|---|
close, isClosed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExceptionConvertingIteration(Iteration<? extends E,? extends Exception> iter)
iter - The Iteration that this ExceptionConvertingIteration
operates on, must not be null.| Method Detail |
|---|
@Deprecated protected X convertedException(Exception e)
convert(Exception) should be used or overridden
instead.
protected X convert(Exception e)
convertedException(Exception) method for backwards compatibility.
public boolean hasNext()
throws X extends Exception
X
X extends Exception
public E next()
throws X extends Exception
X
NoSuchElementException - If all elements have been returned.
IllegalStateException - If the Iteration has been closed.
X extends Exception
public 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 Exception
protected void handleClose()
throws X extends Exception
CloseableIteration.
handleClose in class CloseableIterationBase<E,X extends Exception>X
X extends Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||