public class SimpleOrderedCalendar extends Calendar
Modifier and Type | Class and Description |
---|---|
protected class |
SimpleOrderedCalendar.Entry |
Modifier and Type | Field and Description |
---|---|
protected java.util.SortedMap<PointInTime,java.util.LinkedList<SimpleOrderedCalendar.Entry>> |
timeline
the time line assigns lists of events to their time instances
|
CALENDAR, concurrentEvents, eventsWithSameTimeStat, systemTime
Constructor and Description |
---|
SimpleOrderedCalendar() |
Modifier and Type | Method and Description |
---|---|
void |
cancelAllEvents()
cancels all events
|
PointInTime |
getSystemTime()
Returns the current simulation time
|
boolean |
isEventAvailable()
Return true if there are events in the calendar.
|
PointInTime |
peekNextEventTime()
Returns the time stamp of the next event in the calendar without removing
it.
|
EventToken |
postEvent(CalendarCallback process,
CalendarCallback cancel,
PointInTime eventTime,
int eventPriority)
Creates a new entry in the calendar.
|
void |
processNextEvent()
processes the next event
|
getInstance, hasInstance, postEvent, setInstance, setSameTimeEventStatistic
protected final java.util.SortedMap<PointInTime,java.util.LinkedList<SimpleOrderedCalendar.Entry>> timeline
public EventToken postEvent(CalendarCallback process, CalendarCallback cancel, PointInTime eventTime, int eventPriority)
Calendar
postEvent
in class Calendar
process
- Function to call when the event is processed. May be null.cancel
- Function to call when the event is cancelled. May be null.eventTime
- Time at which to call the onExecute
function. Must
be later or equal than the current system time returned by
Calendar.getSystemTime()
.eventPriority
- Key used for sorting to break ties for two entries with the same
eventTime
.public void cancelAllEvents()
cancelAllEvents
in class Calendar
public void processNextEvent()
processNextEvent
in class Calendar
public boolean isEventAvailable()
Calendar
isEventAvailable
in class Calendar
public PointInTime peekNextEventTime()
Calendar
peekNextEventTime
in class Calendar
public PointInTime getSystemTime()
Calendar
getSystemTime
in class Calendar