All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kraft.monitor.tools.KraftTerm

java.lang.Object
   |
   +----kraft.monitor.tools.KraftTerm

public class KraftTerm
extends Object
Provides functions to manipulate messages/parts of messages provided as TermInStrings.


Constructor Index

 o KraftTerm()

Method Index

 o breakDownTerm(TermInString)
Debugging method: breaks down a term into functor, arity and args and prints them to System.err
 o getFieldValue(TermInString, String)
Get the value of a particular field in a list of form: '.'(:(field,value), '.'(:(field2,value2),[]))
 o getListPair(TermInString, int)
Get the field and value pair of args at position 'pos' in a list of form: '.'(:(field,value), '.'(:(field2,value2),[]))
 o main(String[])
typing java kraft.monitor.tools.KraftTerm will cause the term to be broken down Used for testing

Constructors

 o KraftTerm
 public KraftTerm()

Methods

 o getFieldValue
 public static String getFieldValue(TermInString list,
                                    String field) throws Exception
Get the value of a particular field in a list of form: '.'(:(field,value), '.'(:(field2,value2),[]))

Parameters:
list - a list term in the format shown above
field - the field name required, eg: sender
Returns:
s the value in the :(field,value) pair matchin 'field' or empty string if not found
 o getListPair
 public static String[] getListPair(TermInString list,
                                    int pos) throws Exception
Get the field and value pair of args at position 'pos' in a list of form: '.'(:(field,value), '.'(:(field2,value2),[]))

Parameters:
list - a list term in the above syntax
pos - the position in the list of the pair. NB: first pos is 1
Returns:
s an array of two Strings. the field name at [0], the value at [1] the values of the array will be {"",""} if no pair at the given position
 o breakDownTerm
 public static void breakDownTerm(TermInString t)
Debugging method: breaks down a term into functor, arity and args and prints them to System.err

 o main
 public static void main(String argv[])
typing java kraft.monitor.tools.KraftTerm will cause the term to be broken down Used for testing


All Packages  Class Hierarchy  This Package  Previous  Next  Index