|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsleep.runtime.ScriptInstance
Every piece of information related to a loaded script. This includes the scripts runtime environment, code in compiled form, variable information, and listeners for runtime issues.
Field Summary | |
protected ScriptEnvironment |
environment
The script environment which contains all of the runtime info for a script |
protected boolean |
loaded
true by default, indicates wether or not the script is loaded. |
protected String |
name
the name of this script |
protected Block |
script
The compiled sleep code for this script, the ScriptLoader will set this value upon loading a script. |
protected ScriptVariables |
variables
The script variables which contains all of the variable information for a script |
protected LinkedList |
watchers
A list of listeners watching for a runtime error |
Constructor Summary | |
ScriptInstance()
Constructs a new script instance |
|
ScriptInstance(Hashtable environmentToShare)
|
|
ScriptInstance(Variable varContainerToUse,
Hashtable environmentToShare)
Constructs a script instance, if either of the parameters are null a default implementation will be used. |
Method Summary | |
void |
addWarningWatcher(RuntimeWarningWatcher w)
Register a runtime warning watcher listener. |
Scalar |
callFunction(String funcName,
Stack parameters)
Calls a subroutine/built-in function using this scripts |
void |
fireWarning(String message,
int line)
Fire a runtime script warning |
String |
getName()
Returns the name of this script (typically a full pathname) as a String |
Block |
getRunnableBlock()
Returns the compiled form of this script |
ScriptEnvironment |
getScriptEnvironment()
Returns this scripts runtime environment |
ScriptVariables |
getScriptVariables()
Returns the variable container used by this script |
void |
installBlock(Block _script)
Install a block as the compiled script code |
boolean |
isLoaded()
Returns wether or not this script is loaded. |
void |
removeWarningWatcher(RuntimeWarningWatcher w)
Removes a runtime warning watcher listener |
void |
runScript()
Executes this script, should be done first thing once a script is loaded |
void |
setName(String sn)
Sets the name of this script |
void |
setScriptVariables(ScriptVariables v)
Sets the variable container to be used by this script |
void |
setUnloaded()
Flag this script as unloaded |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String name
protected boolean loaded
protected LinkedList watchers
protected ScriptEnvironment environment
protected ScriptVariables variables
protected Block script
Constructor Detail |
public ScriptInstance(Hashtable environmentToShare)
public ScriptInstance(Variable varContainerToUse, Hashtable environmentToShare)
public ScriptInstance()
Method Detail |
public void installBlock(Block _script)
public ScriptEnvironment getScriptEnvironment()
public void setScriptVariables(ScriptVariables v)
public ScriptVariables getScriptVariables()
public String getName()
public void setName(String sn)
public void runScript()
public Block getRunnableBlock()
public Scalar callFunction(String funcName, Stack parameters)
public void setUnloaded()
public boolean isLoaded()
public void addWarningWatcher(RuntimeWarningWatcher w)
public void removeWarningWatcher(RuntimeWarningWatcher w)
public void fireWarning(String message, int line)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |