public class Message
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
AgentAddress class).AgentAddress,
AbstractAgent.sendMessage(AgentAddress, Message),
AbstractAgent.sendMessage(String, String, String, Message),
Serialized Form| Constructor and Description |
|---|
Message() |
| Modifier and Type | Method and Description |
|---|---|
protected Message |
clone()
Returns a shadow copy of the message.
|
ConversationID |
getConversationID()
returns the conversation ID for this message.
|
AgentAddress |
getReceiver()
Returns the agent address corresponding to the agent that receive this message.
|
AgentAddress |
getSender()
Returns the agent address corresponding to the agent that sends this message.
|
java.lang.String |
toString() |
public AgentAddress getReceiver()
public AgentAddress getSender()
null if
the message has not been sent by an agent, but by any other kind of object.AbstractAgent.sendMessage(AgentAddress, Message),
AbstractAgent.sendMessage(String, String, String, Message)public java.lang.String toString()
toString in class java.lang.Objectprotected Message clone()
AbstractAgent.broadcastMessage(String, String, String, Message)
and the like to set different receivers for each cloned message.clone in class java.lang.Objectpublic ConversationID getConversationID()
AbstractAgent.sendReply(Message, Message) like methods.
Especially, if the answer is again used for replying, the ID
will be used again to tag this new answer, and so on.
Fabien Michel, Olivier Gutknecht, Jacques Ferber - November 18 2014