|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.LookAheadIteration<E,QueryEvaluationException>
org.openrdf.cursor.QueueCursor<E>
public class QueueCursor<E>
Makes working with a queue easier by adding the methods done() and
toss(Exception) and automatically converting the exception into a
StoreException with an appropriate stack trace.
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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 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. |
| Methods inherited from class info.aduna.iteration.LookAheadIteration |
|---|
hasNext, next, remove |
| Methods inherited from class info.aduna.iteration.CloseableIterationBase |
|---|
close, isClosed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueueCursor(int capacity)
capacity - the capacity of this queue
public 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.| Method Detail |
|---|
public void toss(Exception exception)
LookAheadIteration.next() is called this exception will be thrown. If
it is not a StoreException or RuntimeException it will be wrapped in a
StoreException.
public void put(E st)
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>QueryEvaluationException
public void handleClose()
throws QueryEvaluationException
handleClose in class LookAheadIteration<E,QueryEvaluationException>QueryEvaluationException
public void checkException()
throws QueryEvaluationException
QueryEvaluationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||