|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
E - public interface Queue<E>
A queue API that allows batching and pooling of objects. So to offer you first get a mutable object from the queue by calling nextToOffer(), alter the object and call offer(). That allows the queue objects to be pooled, avoiding any garbage collection. And to poll you first call available() to know how many objects you can safely poll, call poll() in a loop and when done call done(). That allows polling to be batched, so you pay a synchronization price only when you call available() and NOT when you call poll().
| Method Summary | |
|---|---|
long |
available()
Return the number of objects that can be safely polled from this queue. |
void |
done()
Called to indicate that all polling have been done. |
E |
nextToOffer()
Return the next pooled mutable object that can be used by the producer. |
void |
offer(E e)
Offer an object to the queue. |
E |
poll()
Poll a object from the queue. |
| Method Detail |
|---|
E nextToOffer()
void offer(E e)
e - the object to be offered to the queue.long available()
E poll()
void done()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||