Package org.eclipse.rdf4j.query.impl
Class QueueCursor<E>
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<E>
org.eclipse.rdf4j.common.iteration.QueueIteration<E,QueryEvaluationException>
org.eclipse.rdf4j.query.impl.QueueCursor<E>
- All Implemented Interfaces:
AutoCloseable,Iterator<E>,CloseableIteration<E>
- Direct Known Subclasses:
FedXQueueCursor
Makes working with a queue easier by adding the methods
QueueIteration.done() and QueueIteration.toss(Exception) and
automatically converting the exception into a QueryEvaluationException with an appropriate stack trace.- Author:
- James Leigh
-
Constructor Summary
ConstructorsConstructorDescriptionQueueCursor(int capacity) Creates an QueueCursor with the given (fixed) capacity and default access policy.QueueCursor(BlockingQueue<E> queue) Deprecated.WeakReference is no longer supported as a way to automatically close this iteration. -
Method Summary
Modifier and TypeMethodDescriptionprotected QueryEvaluationExceptionConverts an exception from the underlying iteration to an exception of type X.Methods inherited from class org.eclipse.rdf4j.common.iteration.QueueIteration
checkException, done, getNextElement, handleClose, put, tossMethods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration
hasNext, next, removeMethods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
streamMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
QueueCursor
public QueueCursor(int capacity) Creates an QueueCursor with the given (fixed) capacity and default access policy.- Parameters:
capacity- the capacity of this queue
-
QueueCursor
Deprecated.WeakReference is no longer supported as a way to automatically close this iteration. The recommended approach to automatically closing an iteration on garbage collection is to use aCleaner.Creates an QueueCursor with the givenBlockingQueueas its backing queue.
It may not be threadsafe to modify or access the givenBlockingQueuefrom other locations. This method only enables the defaultArrayBlockingQueueto be overridden.- Parameters:
queue- A BlockingQueue that is not used in other locations, but will be used as the backing Queue implementation for this cursor.
-
-
Method Details
-
convert
Description copied from class:QueueIterationConverts an exception from the underlying iteration to an exception of type X.- Specified by:
convertin classQueueIteration<E,QueryEvaluationException>
-