Class ExceptionConvertingIteration<E,X extends RuntimeException>
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E>
org.eclipse.rdf4j.common.iteration.ExceptionConvertingIteration<E,X>
- All Implemented Interfaces:
AutoCloseable
,Iterator<E>
,CloseableIteration<E>
@Deprecated(since="4.1.0")
public abstract class ExceptionConvertingIteration<E,X extends RuntimeException>
extends AbstractCloseableIteration<E>
Deprecated.
A CloseableIteration that converts an arbitrary iteration to an iteration with exceptions of type X.
Subclasses need to override
to do the conversion.
invalid reference
#convert(Exception)
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExceptionConvertingIteration
(CloseableIteration<? extends E> iter) Deprecated.Creates a new ExceptionConvertingIteration that operates on the supplied iteration. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract X
Deprecated.Converts an exception from the underlying iteration to an exception of type X.protected void
Deprecated.Closes this Iteration as well as the wrapped Iteration if it happens to be aCloseableIteration
.boolean
hasNext()
Deprecated.Checks whether the underlying Iteration contains more elements.next()
Deprecated.Returns the next element from the wrapped Iteration.void
remove()
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
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ExceptionConvertingIteration
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 Details
-
convert
Deprecated.Converts an exception from the underlying iteration to an exception of type X. -
hasNext
public boolean hasNext()Deprecated.Checks whether the underlying Iteration contains more elements.- Returns:
- true if the underlying Iteration contains more elements, false otherwise.
-
next
Deprecated.Returns the next element from the wrapped Iteration.- Throws:
NoSuchElementException
- If all elements have been returned.IllegalStateException
- If the Iteration has been closed.
-
remove
public void remove()Deprecated.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()
.
-
handleClose
protected void handleClose()Deprecated.Closes this Iteration as well as the wrapped Iteration if it happens to be aCloseableIteration
.- Specified by:
handleClose
in classAbstractCloseableIteration<E>
-