Class ExceptionConvertingIteration<E,X extends Exception>
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
-
- org.eclipse.rdf4j.common.iteration.ExceptionConvertingIteration<E,X>
-
- All Implemented Interfaces:
AutoCloseable,CloseableIteration<E,X>,Iteration<E,X>
- Direct Known Subclasses:
RepositoryExceptionConvertingIteration
@Deprecated(since="4.1.0") public abstract class ExceptionConvertingIteration<E,X extends Exception> extends AbstractCloseableIteration<E,X>
Deprecated.A CloseableIteration that converts an arbitrary iteration to an iteration with exceptions of type X. Subclasses need to overrideconvert(Exception)to do the conversion.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExceptionConvertingIteration(Iteration<? extends E,? extends Exception> iter)Deprecated.Creates a new ExceptionConvertingIteration that operates on the supplied iteration.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract Xconvert(Exception e)Deprecated.Converts an exception from the underlying iteration to an exception of type X.protected voidhandleClose()Deprecated.Closes this Iteration as well as the wrapped Iteration if it happens to be aCloseableIteration.booleanhasNext()Deprecated.Checks whether the underlying Iteration contains more elements.Enext()Deprecated.Returns the next element from the wrapped Iteration.voidremove()Deprecated.Calls remove() on the underlying Iteration.-
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
-
-
-
Constructor Detail
-
ExceptionConvertingIteration
protected ExceptionConvertingIteration(Iteration<? extends E,? extends Exception> iter)
Deprecated.Creates a new ExceptionConvertingIteration that operates on the supplied iteration.- Parameters:
iter- The Iteration that this ExceptionConvertingIteration operates on, must not be null.
-
-
Method Detail
-
convert
protected abstract X convert(Exception e)
Deprecated.Converts an exception from the underlying iteration to an exception of type X.
-
hasNext
public boolean hasNext() throws X extends ExceptionDeprecated.Checks whether the underlying Iteration contains more elements.
-
next
public E next() throws X extends Exception
Deprecated.Returns the next element from the wrapped Iteration.- Returns:
- the next element in the iteration.
- Throws:
XNoSuchElementException- If all elements have been returned.IllegalStateException- If the Iteration has been closed.X extends Exception
-
remove
public void remove() throws X extends ExceptionDeprecated.Calls remove() on the underlying Iteration.- Throws:
UnsupportedOperationException- If the wrapped Iteration does not support the remove operation.IllegalStateException- If the Iteration has been closed, or ifnext()has not yet been called, orremove()has already been called after the last call tonext().X extends Exception
-
handleClose
protected void handleClose() throws X extends ExceptionDeprecated.Closes this Iteration as well as the wrapped Iteration if it happens to be aCloseableIteration.- Overrides:
handleClosein classAbstractCloseableIteration<E,X extends Exception>- Throws:
XX extends Exception
-
-