|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jade.lang.acl.MessageTemplate
A pattern for matching incoming ACL messages. This class allows to
build complex slot patterns to select ACL messages. These patterns
can then be used in receive() operations.
Agent.receive(MessageTemplate mt), Serialized Form| Method Summary | |
static MessageTemplate |
and(MessageTemplate op1,
MessageTemplate op2)
Logical and between two MessageTemplate
objects. |
boolean |
match(ACLMessage msg)
Matches an ACL message against this MessageTemplate
object. |
static MessageTemplate |
MatchAll()
This Factory Method returns a message template that matches any message. |
static MessageTemplate |
MatchContent(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :content slot. |
static MessageTemplate |
MatchConversationId(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :conversation-id slot. |
static MessageTemplate |
MatchCustom(ACLMessage msg,
boolean matchPerformative)
This Factory Method returns a message template that matches ACL messages against a given one, passed as parameter. |
static MessageTemplate |
MatchEncoding(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :encoding slot. |
static MessageTemplate |
MatchInReplyTo(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :in-reply-to slot. |
static MessageTemplate |
MatchLanguage(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :language slot. |
static MessageTemplate |
MatchOntology(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :ontology slot. |
static MessageTemplate |
MatchPerformative(int value)
This Factory Method returns a message template that matches any message with a given performative. |
static MessageTemplate |
MatchProtocol(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :protocol slot. |
static MessageTemplate |
MatchReceiver(java.util.List values)
This Factory Method returns a message template that matches any message with a given :receiver slot. |
static MessageTemplate |
MatchReplyBy(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :reply-by slot. |
static MessageTemplate |
MatchReplyTo(java.util.List values)
This Factory Method returns a message template that matches any message with a given :reply-to slot. |
static MessageTemplate |
MatchReplyWith(java.lang.String value)
This Factory Method returns a message template that matches any message with a given :reply-with slot. |
static MessageTemplate |
MatchSender(AID value)
This Factory Method returns a message template that matches any message with a given :sender slot. |
static MessageTemplate |
not(MessageTemplate op)
Logical not of a MessageTemplate object. |
static MessageTemplate |
or(MessageTemplate op1,
MessageTemplate op2)
Logical or between two MessageTemplate
objects. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public static MessageTemplate MatchAll()
MessageTemplate matching any given
value.public static MessageTemplate MatchSender(AID value)
:sender slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchReceiver(java.util.List values)
:receiver slot.values - A List of Agent IDs against which the
value of the message slot will be matched.MessageTemplate matching the given
value.public static MessageTemplate MatchContent(java.lang.String value)
:content slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchReplyWith(java.lang.String value)
:reply-with slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchInReplyTo(java.lang.String value)
:in-reply-to slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchReplyTo(java.util.List values)
:reply-to slot.values - A List of Agent IDs against which the
value of the message slot will be matched.MessageTemplate matching the given
value.public static MessageTemplate MatchLanguage(java.lang.String value)
:language slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchEncoding(java.lang.String value)
:encoding slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchOntology(java.lang.String value)
:ontology slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchReplyBy(java.lang.String value)
:reply-by slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchProtocol(java.lang.String value)
:protocol slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchConversationId(java.lang.String value)
:conversation-id slot.value - The value the message slot will be matched against.MessageTemplate matching the given
value.public static MessageTemplate MatchPerformative(int value)
value - The value the message slot will be matched against.MessageTenplatematching the given
value.
public static MessageTemplate MatchCustom(ACLMessage msg,
boolean matchPerformative)
ACLMessage has a non
null slot, subsequent messages must have the same
slot value in that slot to have a match.
When the given ACLMessage has a null
slot, subsequent messages can have any value for that slot and
still match the template.
In short, a null value for a slot means don't
care.msg - The ACLMessage used to build a custom
message template.matchPerformative - a bool value. When
true, the performative of the msg will
be considered as a part of the template (i.e. the message
template will match only ACL messages with the same performativa
as msg).
When msg is ignored and
the resulting message template will not consider it when matching
messages.MessageTemplate, matching the given
message according to the above algorithm.
public static MessageTemplate and(MessageTemplate op1,
MessageTemplate op2)
MessageTemplate
objects. This method creates a new message template that is
matched by those ACL messages matching both
message templates given as operands.op1 - The first and operand.op2 - The second and operand.MessageTemplate object.or(MessageTemplate op1, MessageTemplate op2)
public static MessageTemplate or(MessageTemplate op1,
MessageTemplate op2)
MessageTemplate
objects. This method creates a new message template that is
matched by those ACL messages matching any of the
two message templates given as operands.op1 - The first or operand.op2 - The second or operand.MessageTemplate object.and(MessageTemplate op1, MessageTemplate op2)public static MessageTemplate not(MessageTemplate op)
MessageTemplate object. This
method creates a new message template that is matched by those
ACL messages not matching the message template
given as operand.op - The not operand.MessageTemplate object.public boolean match(ACLMessage msg)
MessageTemplate
object.msg - The ACLMessage to check for matching.true if the ACL message matches this
template, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||