public class StdCalendar extends Calendar
Modifier and Type | Field and Description |
---|---|
protected double |
systemTime
the current simulation time
|
Constructor and Description |
---|
StdCalendar() |
Modifier and Type | Method and Description |
---|---|
void |
cancelAllEvents()
Cancel all events which are currently posted.
|
boolean |
cancelAllEvents(Event theEvent)
Cancel all posted occurrences of the given event.
|
boolean |
cancelEvent(Event theEvent)
Cancel the given event.
|
boolean |
cancelEvent(Event theEvent,
double eventTime)
Cancel the given event, which is to be processed at time
eventTime.
|
int |
countEventsInCalendar(Event theEvent)
Counts how often the given event is scheduled.
|
int |
getSize()
Get the current number of events in the calendar.
|
double |
getSystemTime()
Get the current system 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 and removes the next event in the calendar.
|
void |
postEvent(Event theEvent,
double eventTime,
int eventPriority) |
void |
processNextEvent()
Gets the next event on the schedule and calls its event handler method.
|
getInstance, hasInstance, postEvent, setInstance
public void cancelAllEvents()
Calendar
cancelAllEvents
in class Calendar
public boolean cancelAllEvents(Event theEvent)
Calendar
cancelAllEvents
in class Calendar
public boolean cancelEvent(Event theEvent, double eventTime)
Calendar
cancelEvent
in class Calendar
public boolean cancelEvent(Event theEvent)
Calendar
cancelEvent
in class Calendar
public Event popNextEvent()
Calendar
popNextEvent
in class Calendar
public void postEvent(Event theEvent, double eventTime, int eventPriority)
public void processNextEvent()
Calendar
processNextEvent
in class Calendar
public int getSize()
public double getSystemTime()
getSystemTime
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 int countEventsInCalendar(Event theEvent)
Calendar
countEventsInCalendar
in class Calendar
theEvent
- the event to count