|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--solar.util.FastSyncQueue
A synchronized blocking queue based on a fast linked-list. It turns out that using java.util.LinkedList to implement the queue is slower than using solar.util.ssLinkedList.
Field Summary | |
protected ssLinkedList |
_list
|
protected int |
_size
|
Constructor Summary | |
FastSyncQueue()
|
Method Summary | |
java.lang.Object |
dequeue()
Dequeue one data item. |
java.lang.Object |
dequeue(long timeout)
Dequeue one data item within timeout period. |
java.lang.Object[] |
dequeueAll()
Dequeue all the data items currently in the queue. |
void |
enqueue(java.lang.Object item)
Enqueue one data item. |
void |
enqueueAll(java.lang.Object[] items)
Enqueue an array of data items. |
int |
size()
Return the size of the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ssLinkedList _list
protected int _size
Constructor Detail |
public FastSyncQueue()
Method Detail |
public int size()
Queue
size
in interface Queue
public void enqueue(java.lang.Object item)
Queue
enqueue
in interface Queue
public void enqueueAll(java.lang.Object[] items)
Queue
enqueueAll
in interface Queue
public java.lang.Object dequeue() throws java.lang.InterruptedException
Queue
dequeue
in interface Queue
java.lang.InterruptedException
public java.lang.Object dequeue(long timeout) throws java.lang.InterruptedException
Queue
dequeue
in interface Queue
java.lang.InterruptedException
public java.lang.Object[] dequeueAll()
Queue
dequeueAll
in interface Queue
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |