com.agentfactory.cldc.mts
Class Message

java.lang.Object
  extended by com.agentfactory.cldc.mts.Message

public class Message
extends java.lang.Object

This class represents an AFME message. AFME messages comprise a performative, a message sender, the sender's address, and the information content of the message.

Author:
Conor Muldoon

Field Summary
static java.lang.String ACTION
           
static java.lang.String INFORM
           
static java.lang.String REQUEST
           
 
Constructor Summary
Message(java.io.DataInputStream dis, java.lang.String app, Platform p)
          Creates a message from a data input stream.
Message(java.lang.String performative, AgentName senderName, FOS content)
          Creates an instance of Message with no sender addresses.
Message(java.lang.String performative, AgentName senderName, java.lang.Object sendAddr, FOS content)
          Creates an instance of Message with sender addresses.
 
Method Summary
 java.lang.String toBeliefString()
          Converts the message to a belief string.
 void write(java.io.DataOutputStream dos)
          Writes the state of the message to a data output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION

public static final java.lang.String ACTION
See Also:
Constant Field Values

INFORM

public static final java.lang.String INFORM
See Also:
Constant Field Values

REQUEST

public static final java.lang.String REQUEST
See Also:
Constant Field Values
Constructor Detail

Message

public Message(java.lang.String performative,
               AgentName senderName,
               FOS content)
Creates an instance of Message with no sender addresses.

Parameters:
performative - the performative of the message.
senderName - the name of the agent that sent the message.
content - the information content of the message.

Message

public Message(java.lang.String performative,
               AgentName senderName,
               java.lang.Object sendAddr,
               FOS content)
Creates an instance of Message with sender addresses.

Parameters:
performative - the performative of the message.
senderName - the name of the agent that sent the message.
sendAddr - the address of the sender agent.
content - the information content of the message.

Message

public Message(java.io.DataInputStream dis,
               java.lang.String app,
               Platform p)
        throws java.io.IOException
Creates a message from a data input stream.

Parameters:
dis - the data input stream that the message is be constructed from.
app -
p - the local platform, upon which the agents reside.
Throws:
java.io.IOException - if there is an I/O error.
Method Detail

toBeliefString

public java.lang.String toBeliefString()
Converts the message to a belief string.

Returns:
the string representation of the message.

write

public void write(java.io.DataOutputStream dos)
           throws java.io.IOException
Writes the state of the message to a data output stream.

Parameters:
dos - the data output stream that the state is to be written to.
Throws:
java.io.IOException - if there is an I/O error.