All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class KQMLLayer.KQMLmessage

KQMLLayer.KQMLmessage

public class KQMLmessage
KQMLmessage class. Basically KQMLmessage is a Hashtable with key field as slot name and field value as slot value. The peformative key is assumed key as performative. You can retrieve slot value using getValue(String slotname). If you want to retrieve performative, use String perf = kqmlmessage.getValue("performative") where kqmlmessage is instantce of KQMLmessage. The KQML parse has limitations:


Variable Index

 o performative
Default constructor

Constructor Index

 o KQMLmessage()
 o KQMLmessage(KQMLStreamTokenizer)
 o KQMLmessage(String)
Given string, create KQMLmessage object

Method Index

 o addFieldExpressionPair(String, KQMLExpression)
 o addFieldValuePair(String, String)
add field, value pair to construct a KMQLmessage
 o getExpression(String)
 o getReadString()
Returns the KQML message as a single human readable string.
 o getSendString()
Returns the KQML message as a single machine readable string.
 o getValue(String)
Returns the value of the "field" field.
 o parseMessage(KQMLStreamTokenizer)
 o parseMessage(String)
Parse message according to the KQML syntax

Variables

 o performative
 public String performative
Default constructor

Constructors

 o KQMLmessage
 public KQMLmessage()
 o KQMLmessage
 public KQMLmessage(String message) throws ParseException
Given string, create KQMLmessage object

Parameters:
message - String which has legal KQML syntax
Throws: ParseException
if syntax does not match.
 o KQMLmessage
 public KQMLmessage(KQMLStreamTokenizer message) throws ParseException

Methods

 o parseMessage
 public void parseMessage(String str) throws ParseException
Parse message according to the KQML syntax

Parameters:
str - KQML syntax string
Throws: ParseException
if syntax does not match
 o parseMessage
 public void parseMessage(KQMLStreamTokenizer parser) throws ParseException
 o addFieldValuePair
 public void addFieldValuePair(String field,
                               String value)
add field, value pair to construct a KMQLmessage

Parameters:
field - slot name
 o addFieldExpressionPair
 public void addFieldExpressionPair(String field,
                                    KQMLExpression value)
 o getValue
 public String getValue(String field)
Returns the value of the "field" field. If it does not exit, returns null.

Returns:
String representing field value.
 o getExpression
 public KQMLExpression getExpression(String field)
 o getReadString
 public String getReadString()
Returns the KQML message as a single human readable string.

Returns:
Message in string format.
 o getSendString
 public String getSendString()
Returns the KQML message as a single machine readable string. This is the format which is sent to other agents.

Returns:
Message in string format.

All Packages  Class Hierarchy  This Package  Previous  Next  Index