public class LispAction extends SimpleAction
#execute()
),
the action's parameters will be available in the Lisp execution environment as the
values for the symbols corresponding to the parameter names.Creating a new Action is as simple as this:
Action a = new LispAction("add2", "(+ p1 p2)" , new Parameter("p1", Long.class, new Long(0) , new Parameter("p2", Long.class, new Long(0));
Modifier and Type | Field and Description |
---|---|
(package private) String |
code |
params
Constructor and Description |
---|
LispAction(String name,
String implCode,
Param... params) |
Modifier and Type | Method and Description |
---|---|
Status |
execute(Object... args)
The lisp code that was passed as a constructor parameter is executed.
|
static void |
main(String[] args) |
bindParamValues, getName, getParamValue, setParamValues
compareTo, equals, getDefaultIO, getIO, setDefaultIO, setIO, toString
String code
public Status execute(Object... args) throws IllegalOperationException, ClassCastException
SimpleAction.setParamValues(Object...)
If there are more parameters than the values supplied, the excess parameter values are populated
by the default values from the parameter definitions.execute
in class Action
Status
; the value part of the
status should be -ve to indicate failure, 0 to indicate success, ad +ve to
indicate a warning.IllegalOperationException
ClassCastException
public static void main(String[] args)