public interface Event extends Describable
All events have an type, which may be used by the event observers to distinguish between multiple events it is observing.
If an observer wishes to be informed of the occurrence of the event, it must implement the EventObserver
interface. The observer object must also be passed on to #addEventObserver(EventObserver)
. If the observer is added before start()
is called, it is guaranteed to be informed of the event's occurrence. If not, there is no guarantee. When the event occurs, EventObserver.notifyEventOccurred(String,Event,Object)
is called for all registered observers.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PRIORITY
The default priority given to any message without priority field,
or with a mangles priority field.
|
static CasaLispOperator |
FIRE_EVENT
Lisp operator: (FIRE-EVENT)
Fire the current event. |
static int |
HIGHEST_PRIORITY |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer o)
This method adds an
Observer to the observer list. |
int |
countObservers() |
void |
deleteObserver(Observer o) |
void |
fireEvent()
This method calls
EventObserver.notifyEventOccurred(String, Event, Object) for
all observers that have been registered via
#addEventObserver(EventObserver) . |
String |
getEventType()
This method returns the type of this event.
|
int |
getID() |
String |
getOwnerConversationID()
conversationID getter
|
String |
getParameter(String key)
Retrieves a parameter of this object.
|
int |
getPriority()
Indicates the priority of the event
|
long |
getQueueTime()
Used by the EventQueue to set the time this event was queued
|
boolean |
isRecurring()
Determines if this event is recurring.
|
void |
setOwnerConversationID(String id)
conversationID setter
|
void |
setParameter(String key,
String value)
Add the key/value pair to the parameters associated with this event.
|
void |
setParameters(Map<String,String> list)
Add the key/value pairs in list to the parameters associated with this event.
|
int |
setPriority(int priority)
Sets the priority of the event
|
void |
setQueueTime(long time)
Used by the EventQueue to sort events
|
void |
start()
Indicates that notification of the observers can now occur and queues the event
to the agent's event queue.
|
clone, keySet
static final int DEFAULT_PRIORITY
static final int HIGHEST_PRIORITY
static final CasaLispOperator FIRE_EVENT
void addObserver(Observer o)
Observer
to the observer list. All
observers should be notified via
Observer.update(Observable, Object)
when this event
occurs.observer
- The EventObserver
to add to the observer list.void deleteObserver(Observer o)
int countObservers()
String getEventType()
boolean isRecurring()
true
if the event is recurring;
false
otherwise.true
if the event is recurring; false
otherwise.void start()
EventObserver.notifyEventOccurred(String, Event, Object)
method.void fireEvent()
EventObserver.notifyEventOccurred(String, Event, Object)
for
all observers that have been registered via
#addEventObserver(EventObserver)
.int getPriority()
int setPriority(int priority)
long getQueueTime()
void setQueueTime(long time)
time
- String getOwnerConversationID()
void setOwnerConversationID(String id) throws IllegalOperationException
id
- IllegalOperationException
int getID()
void setParameters(Map<String,String> list)
list
- key/value pairsvoid setParameter(String key, String value)
setParameter
in interface Describable
key
- the key name.value
- the value associated with the key.String getParameter(String key)
Describable
getParameter
in interface Describable
key
- the key name