public abstract class QueueIteration<E,T extends Exception> extends LookAheadIteration<E,T>
done()
and toss(Exception)
and after
converting the Exception to the required type using convert(Exception)
.Modifier | Constructor and Description |
---|---|
protected |
QueueIteration(BlockingQueue<E> queue)
Creates an QueueIteration with the given
BlockingQueue as its backing queue.It may not be threadsafe to modify or access the given BlockingQueue from other locations. |
protected |
QueueIteration(int capacity)
Creates an QueueIteration with the given (fixed) capacity and default access policy.
|
protected |
QueueIteration(int capacity,
boolean fair)
Creates an QueueIteration with the given (fixed) capacity and the specified access policy.
|
Modifier and Type | Method and Description |
---|---|
void |
checkException() |
protected abstract T |
convert(Exception e)
Converts an exception from the underlying iteration to an exception of type X.
|
void |
done()
Indicates the method
put(Object) will not be called in the queue anymore. |
E |
getNextElement()
Returns the next item in the queue, which may be null, or throws an exception.
|
void |
handleClose()
Called by
AbstractCloseableIteration.close() when it is called for the first time. |
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, remove
close, isClosed
protected QueueIteration(int capacity)
capacity
- the capacity of this queueprotected QueueIteration(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.protected QueueIteration(BlockingQueue<E> queue)
BlockingQueue
as its backing queue.BlockingQueue
from other locations. This method
only enables the default ArrayBlockingQueue
to be overridden.queue
- A BlockingQueue that is not used in other locations, but will be used as the backing Queue
implementation for this cursor.protected abstract T convert(Exception e)
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, T extends Exception
InterruptedException
T extends Exception
public void done()
put(Object)
will not be called in the queue anymore.public E getNextElement() throws T extends Exception
getNextElement
in class LookAheadIteration<E,T extends Exception>
T extends Exception
public void handleClose() throws T extends Exception
AbstractCloseableIteration
AbstractCloseableIteration.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,T extends Exception>
T extends Exception
Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.