All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kraft.monitor.adapter.Kraft_msg

java.lang.Object
   |
   +----kraft.monitor.adapter.Kraft_msg

public class Kraft_msg
extends Object
implements Message
Represents a kraft_msg/2 term as an object that is recognised as a Message by the Monitor. Parses a (string) term structure into context and core as shown below:
 kraft_msg( context , Core), Core= ccql(Perf, [sender:agent1,...])
 
The core of the message is parsed as a CCQL object.

Author:
Ted Francis
See Also:
CCQL, Message

Variable Index

 o receiver
Field extracted from the context of the message
 o sender
Field extracted from the context of the message
 o time_stamp
Field extracted from the context of the message

Constructor Index

 o Kraft_msg(String)
Construct a new kraft_msg object from the given string.
 o Kraft_msg(TermInString)
Construct a new kraft_msg object from the given Term

Method Index

 o equals(Object)
Whether obj represents the same message as this one
 o getCommandString()
Returns the performative of the CCQL part of the message
 o getContext()
Return the context of the message as a string
 o getCore()
Return the Core of the message as CCQL object
 o getDisplayString(int)
Format the message into a string for displaying
 o toString()
Returns the whole kraft_msg as a simple string

Variables

 o sender
 public String sender
Field extracted from the context of the message

 o receiver
 public String receiver
Field extracted from the context of the message

 o time_stamp
 public String time_stamp
Field extracted from the context of the message

Constructors

 o Kraft_msg
 public Kraft_msg(String str) throws Exception
Construct a new kraft_msg object from the given string. This must be a prolog term structure represented as string.

Throws: Exception
If the string is not valid kraft_msg term.
 o Kraft_msg
 public Kraft_msg(TermInString term) throws Exception
Construct a new kraft_msg object from the given Term

Throws: Exception
If the term is not a valid kraft_msg term

Methods

 o getCore
 public CCQL getCore()
Return the Core of the message as CCQL object

 o getContext
 public String getContext()
Return the context of the message as a string

 o getCommandString
 public String getCommandString()
Returns the performative of the CCQL part of the message

 o toString
 public String toString()
Returns the whole kraft_msg as a simple string

Overrides:
toString in class Object
 o getDisplayString
 public String getDisplayString(int detail)
Format the message into a string for displaying

Parameters:
detail - if 1, displays CCQL.getDisplayString(). if 2, displays context + CCQL.getDisplayString().
See Also:
getDisplayString
 o equals
 public boolean equals(Object obj)
Whether obj represents the same message as this one

Overrides:
equals in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index