public class EventDescriptor extends Object implements Descriptor<Event>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
EventDescriptor.EventDescriptorLispOperator
a class representation of Event Descriptor Lisp Operator
|
Modifier and Type | Field and Description |
---|---|
protected PolicyAgentInterface |
agent
An agent used for type checking of
type against the event type |
private static CasaLispOperator |
EVENT_DESCRIPTOR
Lisp operator: (EVENT-DESCRIPTOR performative act)
Create a EventDescriptor object. |
private String |
name |
private EventPattern |
pattern |
private String |
type
Describes the type of the event descriptor.
|
Constructor and Description |
---|
EventDescriptor(PolicyAgentInterface agent,
String type,
Object... pairs) |
EventDescriptor(PolicyAgentInterface agent,
String type,
Pair<String,? extends Object>[] pairs)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PolicyAgentInterface agent,
EventDescriptor o) |
Act |
getAct() |
protected String |
getLispFunctionName() |
String |
getName() |
EventPattern |
getPattern() |
String |
getPerformative() |
String |
getType() |
Status |
isApplicable(PolicyAgentInterface agent,
Event event)
Returns true if event descriptor matches the event in the context of
the agent.
|
protected static <T extends Comparable<T>> |
makePairs(Object... pairs) |
boolean |
overrides(EventDescriptor other)
Determines if this EventDescriptor should override (replace, takes precidence over)
the other one such that the other one's associated policy doesn't get executed at
all.
|
void |
setPattern(EventPattern p) |
String |
toString() |
protected PolicyAgentInterface agent
type
against the event typeprivate String type
private String name
private EventPattern pattern
private static final CasaLispOperator EVENT_DESCRIPTOR
public EventDescriptor(PolicyAgentInterface agent, String type, Pair<String,? extends Object>[] pairs)
type
- initialized the type
attribute.public EventDescriptor(PolicyAgentInterface agent, String type, Object... pairs)
protected static <T extends Comparable<T>> Pair<String,? extends T>[] makePairs(Object... pairs)
public Status isApplicable(PolicyAgentInterface agent, Event event)
isApplicable
in interface Descriptor<Event>
agent
- the agent that forms the context of evaluation.event
- the event to match against.eventInstanceInfo
- additional context that may be used to determine the match.public int compareTo(PolicyAgentInterface agent, EventDescriptor o)
public boolean overrides(EventDescriptor other)
other
- The EventDescriptor to compare topublic String getPerformative()
public Act getAct()
public EventPattern getPattern()
public void setPattern(EventPattern p)
protected String getLispFunctionName()
public String getName()