|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.cogent.SimEventQueue
The event queue contains a MinHeap to implement a priority queue. It handles adding events, dequeing events, and dequeing all events with the next priority level.
| Field Summary | |
(package private) MinHeap |
myMinHeap
|
| Constructor Summary | |
SimEventQueue()
Constructor, creates an empty EventQueue |
|
| Method Summary | |
SimEvent |
dequeue()
Remove and return the next item from the priority queue. |
java.util.Vector |
dequeueNextPriorityLevel()
This method returns a vector of all events that occur with the next lowest priority, removing them all from the queue |
void |
enqueue(SimEvent argEvent,
long argPriority)
Adds a single event to the event queue with the given priority |
boolean |
isEmpty()
Returns whether the queue has more elements or not |
SimEvent |
peek()
Return the next element in the queue by priority without removing it |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
MinHeap myMinHeap
| Constructor Detail |
public SimEventQueue()
| Method Detail |
public void enqueue(SimEvent argEvent,
long argPriority)
argEvent - Event to add to the queueargPriority - Priority (time) to add item withpublic SimEvent dequeue()
public SimEvent peek()
public boolean isEmpty()
public java.util.Vector dequeueNextPriorityLevel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||