Class EventQueue
java.lang.Object
EventQueue
- 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventQueue
public EventQueue()
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()