|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jess.Deffunction
Class used to represent Deffunctions (functions defined in the Jess language). Note that you can create these form Java code and add them to a Rete engine using Rete.addUserfunction.
(C) 1998 E.J. Friedman-Hill and the Sandia Corporation
Inner Class Summary | |
static class |
Deffunction.Argument
Represents a formal paramter to this deffunction. |
Constructor Summary | |
Deffunction(java.lang.String name,
java.lang.String docstring)
Create a deffunction |
Method Summary | |
java.lang.Object |
accept(Visitor v)
|
void |
addAction(Funcall fc)
Add an action to this deffunction. |
void |
addArgument(java.lang.String name,
int type)
Add a formal argument to this deffunction. |
void |
addValue(Value val)
Add a simple value to this deffunction. |
Value |
call(ValueVector call,
Context context)
Execute this deffunction. |
java.util.Iterator |
getActions()
The body of this Deffunction |
java.util.Iterator |
getArguments()
The formal parameters to this Deffunction |
java.lang.String |
getDocstring()
Fetch the documentation string of this Deffunction |
java.lang.String |
getName()
Fetch the name of this Deffunction |
void |
setDocstring(java.lang.String ds)
Set the documentation string of this Deffunction |
java.lang.String |
toString()
Describe myself |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Deffunction(java.lang.String name, java.lang.String docstring)
name
- the name of the deffunctiondocstring
- the documentation stringMethod Detail |
public final java.lang.String getName()
getName
in interface Userfunction
public final java.lang.String getDocstring()
public final void setDocstring(java.lang.String ds)
ds
- The documentation stringpublic java.util.Iterator getArguments()
public java.util.Iterator getActions()
public void addArgument(java.lang.String name, int type) throws JessException
name
- A name for the variable (without the leading '?')type
- RU.MULTIVARIABLE or RU.VARIABLEpublic void addAction(Funcall fc) throws JessException
fc
- The actionpublic void addValue(Value val)
val
- The valuepublic Value call(ValueVector call, Context context) throws JessException
call
in interface Userfunction
call
- The ValueVector form of the function call used to
invoke this deffunction.c
- The execution contextJessException
- If anything goes wrongpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object accept(Visitor v)
accept
in interface Visitable
|
© 1997 E.J. Friedman-Hill and Sandia Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |