public abstract class Event
extends java.lang.Object
When an event is executed, its ProcessEvent() method is called. This in turn calls the handleProcessEvent() method. If an event has been canceled, its cancelEvent() method is called, which calls handleCancelEvent(). To do useful work with events, handleProcessEvent(),and/or handleCancelEvent() must be implemented in a handler class.
It is important to note that an object of type Event usually represents a
certain event type, which specifies the actions to be taken upon the
processing of a particular event of this type. The actual event, which is
associated with a particular time instant, is created when the Event is
posted to the Calendar
. It is safe to post an event several
times.
Constructor and Description |
---|
Event() |
Modifier and Type | Method and Description |
---|---|
void |
cancelEvent(double eventTime)
Called only by the calendar after the event has been
removed from the calendar data structure.
|
protected abstract void |
handleCancelEvent(double eventTime) |
protected abstract void |
handleProcessEvent(double eventTime) |
boolean |
isPending() |
void |
posted()
Called by the calendar from the
Calendar.postEvent(Event, double, int) method, just before or
after the event has been added to the calendars internal data structures. |
void |
processEvent(double eventTime)
Called only by the calendar after the event has been
removed from the calendar data structure.
|
protected abstract void handleProcessEvent(double eventTime)
protected abstract void handleCancelEvent(double eventTime)
public void processEvent(double eventTime)
eventTime
- the current system timepublic void cancelEvent(double eventTime)
eventTime
- the current system timepublic void posted()
Calendar.postEvent(Event, double, int)
method, just before or
after the event has been added to the calendars internal data structures.public boolean isPending()