public class StdOrderedCalendar extends Calendar
CALENDAR, concurrentEvents, eventsWithSameTimeStat, systemTime
Constructor and Description |
---|
StdOrderedCalendar() |
Modifier and Type | Method and Description |
---|---|
void |
cancelAllEvents()
Cancel all events which are currently posted.
|
int |
getSize()
Get the current number of events in the calendar.
|
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.
|
ikr.simlib.events.calendar.StdOrderedCalendar.Entry |
popNextEvent() |
EventToken |
postEvent(CalendarCallback onExecute,
CalendarCallback onCancel,
PointInTime eventTime,
int eventPriority)
Creates a new entry in the calendar.
|
void |
processNextEvent()
Gets the next event on the schedule and calls its onExecute method.
|
getInstance, getSystemTime, hasInstance, postEvent, setInstance, setSameTimeEventStatistic
public void cancelAllEvents()
Calendar
cancelAllEvents
in class Calendar
public ikr.simlib.events.calendar.StdOrderedCalendar.Entry popNextEvent()
public EventToken postEvent(CalendarCallback onExecute, CalendarCallback onCancel, PointInTime eventTime, int eventPriority)
Calendar
postEvent
in class Calendar
onExecute
- Function to call when the event is processed. May be null.onCancel
- 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 processNextEvent()
Calendar
processNextEvent
in class Calendar
public int getSize()
public boolean isEventAvailable()
Calendar
isEventAvailable
in class Calendar
public PointInTime peekNextEventTime()
Calendar
peekNextEventTime
in class Calendar