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