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, setInstance
public void postEvent(Event theEvent, double eventTime, int eventPriority)
public Event popNextEvent()
popNextEvent
in class Calendar
public void cancelAllEvents()
cancelAllEvents
in class Calendar
public boolean cancelAllEvents(Event theEvent)
cancelAllEvents
in class Calendar
public boolean cancelEvent(Event theEvent, double eventTime)
cancelEvent
in class Calendar
public boolean cancelEvent(Event theEvent)
cancelEvent
in class Calendar
public void processNextEvent()
processNextEvent
in class Calendar
public boolean isEventAvailable()
Calendar
isEventAvailable
in class Calendar
public Event peekNextEvent()
Calendar
peekNextEvent
in class Calendar
public double peekNextEventTime()
Calendar
peekNextEventTime
in class Calendar
public double getSystemTime()
Calendar
getSystemTime
in class Calendar
public int countEventsInCalendar(Event theEvent)
Calendar
countEventsInCalendar
in class Calendar
theEvent
- the event to count