|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--utilities.Message | +--utilities.KQMLMessage
This class is essentially a wrapper for the KQMLLayer message class
Constructor Summary | |
KQMLMessage(java.lang.Object c,
java.lang.String da)
A "tell" message |
|
KQMLMessage(java.lang.String s)
Send in your encoded message to decode it |
|
KQMLMessage(java.lang.String p,
java.lang.Object c,
java.lang.String da)
Normal constructor |
|
KQMLMessage(java.lang.String p,
java.lang.Object c,
java.lang.String da,
int po)
Normal constructor |
Method Summary | |
void |
addField(java.lang.String fn,
java.lang.String fc)
Adds a field/ value pair to the message |
java.lang.Object |
clone()
Clone |
java.lang.String |
contentData()
Returns the data in the content (the stuff after the first word in the content), cleaning the KQML stuff off first |
java.lang.String |
contentWord()
Returns the first word in the content (used to determine the type of content), cleaning the KQML stuff off first |
java.lang.String |
getField(java.lang.String fn)
Get a field/ value pair to the message |
java.lang.String |
getPerformative()
Performative accessors |
void |
removeField(java.lang.String fn)
Removes a field/ value pair from the message |
void |
setContent(java.lang.Object c)
Sets the message's content string |
void |
setDestAddr(java.lang.String da)
Sets the message's destination address |
void |
setDestPort(int dp)
Sets the message's destination port |
void |
setPerformative(java.lang.String p)
|
void |
setSourceAddr(java.lang.String sa)
Sets the message's source address |
void |
setSourcePort(int sp)
Sets the message's source port |
java.lang.String |
toString()
Stringify, not the same thing as the network-ready data string |
Methods inherited from class utilities.Message |
contentData, contentWord, getConnection, getContent, getData, getDestAddr, getDestPort, getReceiveTime, getSendTime, getSourceAddr, getSourcePort, receive, receive, receive, send, send, setConnection, setData, setReceiveTime, setSendTime |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public KQMLMessage(java.lang.String s)
s
- The KQML formatted message to decodepublic KQMLMessage(java.lang.Object c, java.lang.String da)
c
- The content to sendda
- The destination addresspublic KQMLMessage(java.lang.String p, java.lang.Object c, java.lang.String da)
p
- The message performative (e.g. "ask", "tell", etc.)c
- The content to sendda
- The destination addresspublic KQMLMessage(java.lang.String p, java.lang.Object c, java.lang.String da, int po)
p
- The message performative (e.g. "ask", "tell", etc.)c
- The content to sendda
- The destination addresspo
- The port numberMethod Detail |
public void addField(java.lang.String fn, java.lang.String fc)
fn
- The name of the field to add (e.g. "in-reply-to")fc
- The content of that field (e.g. "pulse")public void removeField(java.lang.String fn)
fn
- The name of the field to remove (e.g. "in-reply-to")public java.lang.String getField(java.lang.String fn)
fn
- The name of the field to get (e.g. "in-reply-to")public java.lang.String getPerformative()
public void setPerformative(java.lang.String p)
public void setContent(java.lang.Object c)
setContent
in class Message
c
- The contentpublic void setDestAddr(java.lang.String da)
setDestAddr
in class Message
da
- The destination, typically an agent's namepublic void setDestPort(int dp)
setDestPort
in class Message
sp
- The destination port numberpublic void setSourceAddr(java.lang.String sa)
setSourceAddr
in class Message
sa
- The source, the name of the agent sending the messagepublic void setSourcePort(int sp)
setSourcePort
in class Message
sp
- The source port numberpublic java.lang.String contentWord()
contentWord
in class Message
utilities.Message
public java.lang.String contentData()
contentData
in class Message
utilities.Message
public java.lang.Object clone()
clone
in class Message
public java.lang.String toString()
toString
in class Message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |