public class SimpleCalendar extends Calendar
| Modifier and Type | Field and Description |
|---|---|
protected double |
systemTime
the current simulation time
|
| Constructor and Description |
|---|
SimpleCalendar() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelAllEvents()
cancels all events
|
boolean |
cancelAllEvents(Event theEvent)
cancels all instances of one event
|
boolean |
cancelEvent(Event theEvent)
removes one specific event
|
boolean |
cancelEvent(Event theEvent,
double eventTime)
removes one specific event at one specific time
|
int |
countEventsInCalendar(Event theEvent)
Counts how often the given event is scheduled.
|
double |
getSystemTime()
Returns the current simulation time
|
boolean |
isEventAvailable()
Return true if there are events in the calendar.
|
Event |
peekNextEvent()
Returns the next event in the calendar without removing it.
|
double |
peekNextEventTime()
Returns the time stamp of the next event in the calendar without removing
it.
|
Event |
popNextEvent()
returns the first event of the earliest event list
|
void |
postEvent(Event theEvent,
double eventTime,
int eventPriority) |
void |
processNextEvent()
processes the next event
|
getInstance, hasInstance, postEvent, setInstancepublic void postEvent(Event theEvent, double eventTime, int eventPriority)
public Event popNextEvent()
popNextEvent in class Calendarpublic void cancelAllEvents()
cancelAllEvents in class Calendarpublic boolean cancelAllEvents(Event theEvent)
cancelAllEvents in class Calendarpublic boolean cancelEvent(Event theEvent, double eventTime)
cancelEvent in class Calendarpublic boolean cancelEvent(Event theEvent)
cancelEvent in class Calendarpublic void processNextEvent()
processNextEvent in class Calendarpublic boolean isEventAvailable()
CalendarisEventAvailable in class Calendarpublic Event peekNextEvent()
CalendarpeekNextEvent in class Calendarpublic double peekNextEventTime()
CalendarpeekNextEventTime in class Calendarpublic double getSystemTime()
CalendargetSystemTime in class Calendarpublic int countEventsInCalendar(Event theEvent)
CalendarcountEventsInCalendar in class CalendartheEvent - the event to count