public class QueueCursor<E> extends LookAheadIteration<E,QueryEvaluationException>
done() and
toss(Exception) and automatically converting the exception into a
QueryEvaluationException with an appropriate stack trace.| Constructor and Description |
|---|
QueueCursor(int capacity)
Creates an QueueCursor with the given (fixed) capacity and
default access policy.
|
QueueCursor(int capacity,
boolean fair)
Creates an QueueCursor with the given (fixed) capacity and the
specified access policy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkException() |
void |
done()
Indicates the method
put(Object) will not be called in the queue
anymore. |
E |
getNextElement()
Returns the next item in the queue or throws an exception.
|
void |
handleClose() |
void |
put(E item)
Adds another item to the queue, blocking while the queue is full.
|
void |
toss(Exception exception)
The next time
LookAheadIteration.next() is called this exception will be thrown. |
hasNext, next, removeclose, isClosedpublic QueueCursor(int capacity)
capacity - the capacity of this queuepublic QueueCursor(int capacity,
boolean fair)
capacity - the capacity of this queuefair - if true then queue accesses for threads blocked on
insertion or removal, are processed in FIFO order; if
false the access order is unspecified.public void toss(Exception exception)
LookAheadIteration.next() is called this exception will be thrown. If
it is not a QueryEvaluationException or RuntimeException it will be
wrapped in a QueryEvaluationException.public void put(E item) throws InterruptedException
InterruptedExceptionpublic void done()
put(Object) will not be called in the queue
anymore.public E getNextElement() throws QueryEvaluationException
getNextElement in class LookAheadIteration<E,QueryEvaluationException>QueryEvaluationExceptionpublic void handleClose()
throws QueryEvaluationException
handleClose in class LookAheadIteration<E,QueryEvaluationException>QueryEvaluationExceptionpublic void checkException()
throws QueryEvaluationException
QueryEvaluationExceptionCopyright © 2001-2015 Aduna. All Rights Reserved.