|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsleep.bridges.BasicNumbers
public class BasicNumbers
provides some of the basic number crunching functionality
Constructor Summary | |
---|---|
BasicNumbers()
|
Method Summary | |
---|---|
boolean |
decide(java.lang.String n,
ScriptInstance i,
java.util.Stack l)
decides the truthfulness of the proposition predicateName applied to the passedInTerms. |
Scalar |
evaluate(java.lang.String name,
ScriptInstance si,
java.util.Stack args)
Evaluate a function and return the resulting scalar. |
Scalar |
operate(java.lang.String o,
ScriptInstance i,
java.util.Stack locals)
apply operator operatorName on the values in the stack. |
boolean |
scriptLoaded(ScriptInstance aScript)
called when a script is loaded |
boolean |
scriptUnloaded(ScriptInstance aScript)
called when a script is unloaded |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicNumbers()
Method Detail |
---|
public boolean scriptUnloaded(ScriptInstance aScript)
Loadable
scriptUnloaded
in interface Loadable
public boolean scriptLoaded(ScriptInstance aScript)
Loadable
scriptLoaded
in interface Loadable
public Scalar evaluate(java.lang.String name, ScriptInstance si, java.util.Stack args)
Function
evaluate
in interface Function
name
- the function being called.si
- an instance of the script calling this function.args
- a stack containing the locals passed to this function. The locals are Scalar values passed in reverse order i.e. [arg n, arg n-1, ..., arg 1, arg 0]
SleepUtils.runCode(Function, String, ScriptInstance, Stack)
public boolean decide(java.lang.String n, ScriptInstance i, java.util.Stack l)
Predicate
decide
in interface Predicate
n
- a predicate i.e. ==i
- an instance of the script asking about this predicate.l
- a stack of terms i.e. [3, 4]. These arguments are passed in REVERSE ORDER i.e. [right hand side, left hand side]
public Scalar operate(java.lang.String o, ScriptInstance i, java.util.Stack locals)
Operator
operate
in interface Operator
o
- the name of the operator, for example the String "+"i
- instance of the script calling this operatorlocals
- a stack containing values the operator is to be applied to: [left hand side, right hand side]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |