|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EventQueue
An EventQueue maintains a queue of events in scheduled time order. An EventQueue also keeps track of time. When created, its current time is set to 0. Each time an event is removed, its current time is updated to the scheduled time for the removed event.
Constructor Summary | |
EventQueue()
new EventQueue() returns an empty EventQueue. |
Method Summary | |
int |
getCurrentTime()
eq.getCurrentTime() returns the current time for eq. |
int |
getEventCount()
eq.getEventCount() returns the number of events in eq. |
NetEvent |
getNextEvent()
eq.getNextEvent() removes and returns the event with the earliest scheduled time in eq. |
void |
schedule(NetEvent e,
int tm)
eq.schedule(e, tm) schedules e at time tm in eq. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventQueue()
Method Detail |
public int getEventCount()
public NetEvent getNextEvent()
Precondition: eq.getEventCount() > 0
public void schedule(NetEvent e, int tm)
public int getCurrentTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |