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()
Called by
CloseableIterationBase.close() when it is called for the first time. |
void |
put(E st)
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, remove
close, isClosed
public 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 st) throws InterruptedException
InterruptedException
public void done()
put(Object)
will not be called in the queue
anymore.public E getNextElement() throws QueryEvaluationException
getNextElement
in class LookAheadIteration<E,QueryEvaluationException>
QueryEvaluationException
public void handleClose() throws QueryEvaluationException
CloseableIterationBase
CloseableIterationBase.close()
when it is called for the first time. This method
is only called once on each iteration. By default, this method does
nothing.handleClose
in class LookAheadIteration<E,QueryEvaluationException>
QueryEvaluationException
public void checkException() throws QueryEvaluationException
QueryEvaluationException
Copyright © 2001-2016 Aduna. All Rights Reserved.