ptolemy.domains.de.kernel
Interface DEEventQueue

All Superinterfaces:
ptolemy.kernel.util.Debuggable
All Known Implementing Classes:
DECQEventQueue

public interface DEEventQueue
extends ptolemy.kernel.util.Debuggable

This interface defines the global event queue used by DE directors to sort and manage events. Events are sorted according to their time stamps, microstep and the depth of the destination actor. One DEEvent is said to be earlier than another, if it has a smaller time stamp, or when the time stamps 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, the events are stored in a FIFO way.

Since:
Ptolemy II 0.2
Version:
$Id: DEEventQueue.java,v 1.26 2004/04/13 03:29:04 cxh Exp $
Author:
Lukito Muliadi, Jie Liu
See Also:
DEReceiver, CalendarQueue, DEDirector
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (liuj)

Method Summary
 void clear()
          Empty this event queue.
 DEEvent get()
          Return the event associated with the earliest tag in this event queue.
 boolean isEmpty()
          Return true if this event queue is empty.
 void put(DEEvent event)
          Enqueue an event into the event queue.
 DEEvent take()
          Dequeue the earliest event in this event queue.
 
Methods inherited from interface ptolemy.kernel.util.Debuggable
addDebugListener, removeDebugListener
 

Method Detail

clear

public void clear()
Empty this event queue.


get

public DEEvent get()
            throws ptolemy.kernel.util.InvalidStateException
Return the event associated with the earliest tag in this event queue. Note that the event is not dequeued.

Returns:
The earliest event.
Throws:
ptolemy.kernel.util.InvalidStateException - If the queue is empty.

isEmpty

public boolean isEmpty()
Return true if this event queue is empty.

Returns:
True if this queue is empty, false otherwise.

put

public void put(DEEvent event)
         throws ptolemy.kernel.util.IllegalActionException
Enqueue an event into the event queue.

Parameters:
event - The event to be put into the queue.
Throws:
ptolemy.kernel.util.IllegalActionException - If the event cannot be enqueued.

take

public DEEvent take()
             throws ptolemy.kernel.util.InvalidStateException
Dequeue the earliest event in this event queue.

Returns:
The DEEvent object associated with the earliest event in the queue.
Throws:
ptolemy.kernel.util.InvalidStateException - If the queue is empty.