All Packages Class Hierarchy This Package Previous Next Index
Class sics.agentbase.core.AgentMessage
java.lang.Object
|
+----sics.agentbase.core.Message
|
+----sics.agentbase.core.AgentMessage
- public class AgentMessage
- extends Message
-
fields
- Table containing all valid field names as Strings.
-
messageTree
- Datastructure containing the message.
-
types
- Table containing all valid message types as Strings.
-
AgentMessage()
- Constructs an empty Agent Message.
-
getMessageField(String)
- Returns the specified message field.
-
getMessageType()
- Returns the message type.
-
makeHash(String[])
- Generates a Hashtable containing all the keys in the specified array
and with an empty string as value.
-
readMessage(InputStream)
- Reads and parses a message from the specified input stream.
-
setMessageField(String, Node)
- Sets the specified message field.
-
setMessageType(String)
- Set the message type for this message.
-
toString()
- Returns a string representation of this message.
fields
protected Hashtable fields
- Table containing all valid field names as Strings.
types
protected Hashtable types
- Table containing all valid message types as Strings.
messageTree
protected ASTSNode messageTree
- Datastructure containing the message.
AgentMessage
public AgentMessage()
- Constructs an empty Agent Message.
makeHash
protected static final Hashtable makeHash(String keys[])
- Generates a Hashtable containing all the keys in the specified array
and with an empty string as value.
- Parameters:
- keys - a string array with keys.
- Returns:
- a Hashtable with the specified keys.
getMessageType
public synchronized String getMessageType()
- Returns the message type.
- Returns:
- the message type or
null if none exists.
setMessageType
public synchronized void setMessageType(String type) throws IOException
- Set the message type for this message.
- Parameters:
- type - the message type.
- Throws: IOException
- if an illegal message type is specified.
getMessageField
protected synchronized Node getMessageField(String name)
- Returns the specified message field.
- Parameters:
- name - the name of the message field to be returned.
- Returns:
- the value of the message field or
null if the
field does not exist.
setMessageField
protected synchronized void setMessageField(String name,
Node node) throws IOException
- Sets the specified message field.
- Parameters:
- name - the name of the message field to set.
- node - the value of the message field to set.
- Throws: IOException
- if an illegal message type is specified.
readMessage
public synchronized void readMessage(InputStream stream) throws IOException
- Reads and parses a message from the specified input stream.
The new values replaces the current values in the message.
- Parameters:
- stream - the input stream to read from.
- Throws: IOException
- if an I/O or parse error occurs.
toString
public synchronized String toString()
- Returns a string representation of this message.
- Returns:
- a string representation of this message.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index