|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsleep.engine.Block
A Block is the fundamental unit of parsed and ready to execute sleep code.
To execute a block of code:
ScriptInstance script; // asume Block code; // assume ScriptEnvironment env = script.getEnvironment(); Scalar value = SleepUtils.runCode(code, env);
The variable value would contain the return value after the block was executed. It is recommended blocks only be run using SleepUtils.runCode() as there is a little bit of synchronization and cleanup that has to be done prior to and after executing a block of code.
Scalar
,
ScriptEnvironment
,
ScriptInstance
,
Serialized FormConstructor Summary | |
Block()
|
Method Summary | |
void |
add(Step n)
|
Scalar |
evaluate(ScriptEnvironment environment)
evaluates this block of code. |
int |
getApproximateLineNumber()
Returns an approximated line number for the steps in this block object... |
String |
getApproximateLineRange()
Returns an approximate range of line numbers for the steps in this block object. |
String |
toString()
Returns a string representation of the Abstract Syntax Tree (AST). |
String |
toString(String prefix)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Block()
Method Detail |
public String toString(String prefix)
public String toString()
public int getApproximateLineNumber()
public String getApproximateLineRange()
public void add(Step n)
public Scalar evaluate(ScriptEnvironment environment)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |