|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sleep.bridges.SleepClosure
public class SleepClosure
The Sleep Closure class. This class represents a Function object that is also a self contained closure
Constructor Summary | |
---|---|
SleepClosure(ScriptInstance si,
Block _code)
Creates a new Sleep Closure, with a brand new set of internal variables. |
|
SleepClosure(ScriptInstance si,
Block _code,
Variable _var)
Creates a new Sleep Closure that uses the specified variable container for its internal variables |
Method Summary | |
---|---|
Scalar |
callClosure(java.lang.String message,
ScriptInstance si,
java.util.Stack locals)
"Safely" calls this closure. |
Scalar |
evaluate(java.lang.String message,
ScriptInstance si,
java.util.Stack locals)
Evaluates the closure, use callClosure instead. |
java.lang.Object |
getAndRemoveMetadata(java.lang.Object key,
java.lang.Object defaultv)
obtain a key from the metadata store associated with this closure |
ScriptInstance |
getOwner()
Returns the owning script instance |
Block |
getRunnableCode()
Returns the runnable block of code associated with this closure |
Variable |
getVariables()
Returns the variable container for this closures |
void |
putMetadata(java.lang.Object key,
java.lang.Object value)
put some value into the metadata store associated with this closure. |
void |
run()
"Safely" calls this closure. |
java.util.Iterator |
scalarIterator()
|
void |
setVariables(Variable _variables)
Sets the variable environment for this closure |
java.lang.String |
toString()
Information about this closure in the form of &closure[ |
java.lang.String |
toStringGeneric()
Returns a generic string version of this closure without id information |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SleepClosure(ScriptInstance si, Block _code)
public SleepClosure(ScriptInstance si, Block _code, Variable _var)
Method Detail |
---|
public java.util.Iterator scalarIterator()
public void putMetadata(java.lang.Object key, java.lang.Object value)
public java.lang.Object getAndRemoveMetadata(java.lang.Object key, java.lang.Object defaultv)
public java.lang.String toStringGeneric()
public java.lang.String toString()
public ScriptInstance getOwner()
public Block getRunnableCode()
public Variable getVariables()
public void setVariables(Variable _variables)
public void run()
run
in interface java.lang.Runnable
public Scalar callClosure(java.lang.String message, ScriptInstance si, java.util.Stack locals)
message
- the message to pass to this closure (available as $0)the
- calling script instance (null value assumes same as owner)the
- local data as a stack object (available as $1 .. $n)
public Scalar evaluate(java.lang.String message, ScriptInstance si, java.util.Stack locals)
evaluate
in interface Function
message
- the function being called.si
- an instance of the script calling this function.locals
- 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |