|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.domains.de.kernel.DECQEventQueue
public class DECQEventQueue
A calendar queue implementation of the DE event queue.
This queue stores DE events in the order of their timestamps,
microsteps, and then depths of their destination actors. See
DEEventQueue
for more explanation of the order of DE events.
Its complexity is theoretically O(1) for both enqueue and dequeue
operations, assuming a reasonable distribution of timestamps. See
CalendarQueue
.
Green (hyzheng) |
Green (hyzheng) |
Nested Class Summary | |
---|---|
private static class |
DECQEventQueue.DECQComparator
|
Field Summary | |
---|---|
private CalendarQueue |
_cQueue
|
Constructor Summary | |
---|---|
DECQEventQueue()
Construct an empty event queue. |
|
DECQEventQueue(int minBinCount,
int binCountFactor,
boolean isAdaptive)
Construct an empty event queue with the specified parameters. |
Method Summary | |
---|---|
void |
addDebugListener(DebugListener listener)
Append a listener to the current set of debug listeners. |
void |
clear()
Empty the event queue. |
DEEvent |
get()
Return the earliest DE event in the queue without removing it from the queue. |
boolean |
isEmpty()
Return true if this event queue is empty. |
void |
put(DEEvent event)
Put an event into the event queue. |
void |
removeDebugListener(DebugListener listener)
Unregister a debug listener. |
int |
size()
Return the size of the event queue. |
DEEvent |
take()
Dequeue the earliest DE event in this event queue. |
java.lang.Object[] |
toArray()
Return the events currently in the queue as an array. |
java.lang.String |
toString()
Describe the Contents of the queue as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private CalendarQueue _cQueue
Constructor Detail |
---|
public DECQEventQueue()
public DECQEventQueue(int minBinCount, int binCountFactor, boolean isAdaptive)
minBinCount
- The minimum number of bins.binCountFactor
- The factor when changing the bin count.isAdaptive
- If the queue changes its number of bins at run time.Method Detail |
---|
public void addDebugListener(DebugListener listener)
addDebugListener
in interface Debuggable
listener
- A listener to which to send debug messages.removeDebugListener(DebugListener)
public void clear()
clear
in interface DEEventQueue
public final DEEvent get()
get
in interface DEEventQueue
InvalidStateException
- If the queue is empty.public final boolean isEmpty()
isEmpty
in interface DEEventQueue
public final void put(DEEvent event)
put
in interface DEEventQueue
event
- The event to enqueue.public void removeDebugListener(DebugListener listener)
removeDebugListener
in interface Debuggable
listener
- The listener to remove from the list of listeners
to which debug messages are sent.addDebugListener(DebugListener)
public final int size()
size
in interface DEEventQueue
public final DEEvent take()
take
in interface DEEventQueue
InvalidStateException
- If the queue is empty.public final java.lang.Object[] toArray()
toArray
in interface DEEventQueue
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |