Class EventQueue

java.lang.Object
  extended byEventQueue

public class EventQueue
extends Object

EventQueue It's called an event "queue," but it's not really. Instead, it's a list (could be an array, could be a linked list) that always keeps its elements in time sorted order. When you get the nextEvent, you KNOW that it's the one with the lowest time in the EventQueue


Constructor Summary
EventQueue()
           
 
Method Summary
 void add(SimEvent myEvent)
          Add the event.
 boolean empty()
           
 void insertInOrder(SimEvent thisEvent)
          Put thisEvent into elements, assuming that it's already in order.
 SimEvent peek()
           
 SimEvent pop()
           
 int size()
           
 void sort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventQueue

public EventQueue()
Method Detail

add

public void add(SimEvent myEvent)
Add the event. The Queue MUST remain in order, from lowest time to highest.


peek

public SimEvent peek()

pop

public SimEvent pop()

size

public int size()

empty

public boolean empty()

insertInOrder

public void insertInOrder(SimEvent thisEvent)
Put thisEvent into elements, assuming that it's already in order.


sort

public void sort()