|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.actors.eventloops.EventQueue
A simple synchronized blocking FIFO queue implementation. The buffer will grow dynamically to accomodate more events when necessary.
Field Summary | |
private static int |
_DEFAULT_QUEUE_SIZE_
|
private java.util.Vector |
elements_
|
Constructor Summary | |
EventQueue()
|
Method Summary | |
Event |
dequeue()
Dequeue an event from the buffer. |
void |
enqueue(Event event)
Enqueue an event in the buffer. |
void |
enqueueFirst(Event event)
Enqueue an event as the first to be executed in the buffer. |
java.util.Vector |
flush()
Clears the content of the buffer and returns the old contents. |
boolean |
isEmpty()
Tests whether the event queue is empty. |
void |
merge(java.util.Vector contents)
Allows for restoring the buffer's old contents by putting the elements in contents in front of the buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int _DEFAULT_QUEUE_SIZE_
private final java.util.Vector elements_
Constructor Detail |
public EventQueue()
Method Detail |
public void enqueue(Event event)
public void enqueueFirst(Event event)
public Event dequeue() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the thread is interrupted while waiting on an empty buffer.public java.util.Vector flush()
public void merge(java.util.Vector contents)
public boolean isEmpty()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |