org.intranet.sim.event
Class EventQueue
java.lang.Object
org.intranet.sim.event.EventQueue
- public final class EventQueue
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentTime
private long currentTime
lastTime
private long lastTime
lastEventProcessTime
private long lastEventProcessTime
eventSet
private java.util.SortedSet eventSet
listeners
private java.util.List listeners
EventQueue
public EventQueue()
addEvent
public void addEvent(Event event)
removeEvent
public void removeEvent(Event event)
getEventList
public java.util.List getEventList()
processEventsUpTo
public boolean processEventsUpTo(long time)
- Processes events in the event list up to the requested time.
The method throws an exception if the requested time is before the
last processed time mark. The remainging pending events that require
updates are also notified.
- Parameters:
time
- The requested time to process up to in the list of events.
- Returns:
- true if events were processed
- Throws:
java.lang.RuntimeException
- When the requested time is before the last time.
updateEventProgress
private int updateEventProgress()
addListener
public void addListener(EventQueue.Listener listener)
removeListener
public void removeListener(EventQueue.Listener listener)
getCurrentTime
public long getCurrentTime()
getLastEventProcessTime
public long getLastEventProcessTime()