|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DEEventQueue
This interface defines an event queue used by DE directors to sort and manage DE events.
DE events are sorted according to their timestamps, microsteps, and then the depths of the destination actors. One DE event is said to be earlier than another, if it has a smaller timestamp, or when the timestamps are identical, it has a smaller microstep, or when both time stamps and microsteps are identical, it has a smaller depth. If all three entries are identical, then these two DE events are called identical.
This interface defines a few methods to manage the event queue, including adding a new event into the queue, getting the earliest event of the queue. A correct implementation of this interface should not allow identical events. In particular, when adding a new event, the event is not added if the event is already in the queue. Also note that calling the get() method does not delete events from event queue but calling the take() method does.
DEEvent
Green (hyzheng) |
Green (hyzheng) |
Method Summary | |
---|---|
void |
clear()
Empty this event queue. |
DEEvent |
get()
Return the earliest DE event in this event queue. |
boolean |
isEmpty()
Return true if this event queue is empty. |
void |
put(DEEvent event)
Enqueue a DE event into the event queue. |
int |
size()
Return the size of the event queue. |
DEEvent |
take()
Return the earliest DE event in this event queue. |
java.lang.Object[] |
toArray()
Return the events currently in the queue as an array. |
Methods inherited from interface ptolemy.kernel.util.Debuggable |
---|
addDebugListener, removeDebugListener |
Method Detail |
---|
void clear()
DEEvent get() throws InvalidStateException
InvalidStateException
- If the event queue is empty.boolean isEmpty()
void put(DEEvent event) throws IllegalActionException
event
- The DE event to be put into the queue.
IllegalActionException
- If the event cannot be enqueued.int size()
DEEvent take() throws InvalidStateException
InvalidStateException
- If the queue is empty.java.lang.Object[] toArray()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |