|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jess.Deffunction
A Deffunction is a function defined in the Jess language. Note that
you can create these from Java code and add them to a Rete engine
using Rete.addUserfunction(jess.Userfunction)
.
(C) 2006 Sandia National Laboratories
Nested Class Summary | |
static class |
Deffunction.Argument
Represents a formal parameter to a Deffunction . |
Constructor Summary | |
Deffunction(java.lang.String name,
java.lang.String docstring)
Create a deffunction |
Method Summary | |
java.lang.Object |
accept(Visitor v)
Deffunction participates in the visitor pattern. |
void |
addAction(Funcall fc)
Add an action to this deffunction. |
void |
addArgument(Deffunction.Argument argument)
Add a formal argument 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()
Return formal parameters to this Deffunction |
java.lang.String |
getConstructType()
Identify this construct type. |
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()
getDocstring
in interface Named
public final void setDocstring(java.lang.String ds)
ds
- The documentation stringpublic java.util.Iterator getArguments()
Deffunction.Argument
objectspublic java.util.Iterator getActions()
Value
objects representing the body of the Deffunctionpublic void addArgument(java.lang.String name, int type) throws JessException
name
- A name for the variable (without the leading '?')type
- RU.MULTIVARIABLE or RU.VARIABLE
JessException
public void addArgument(Deffunction.Argument argument) throws JessException
argument
- A description of the argument
JessException
public void addAction(Funcall fc) throws JessException
fc
- the action
JessException
public 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.context
- The execution context
JessException
- If anything goes wrongValue.resolveValue(jess.Context)
public java.lang.String toString()
public java.lang.Object accept(Visitor v)
accept
in interface Visitable
v
- a Visitor
Visitor.visitDeffunction(jess.Deffunction)
function returnspublic final java.lang.String getConstructType()
getConstructType
in interface Named
|
© 2007 Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |