sleep.bridges
Class DefaultEnvironment

java.lang.Object
  extended by sleep.bridges.DefaultEnvironment
All Implemented Interfaces:
Environment, Loadable

public class DefaultEnvironment
extends java.lang.Object
implements Loadable, Environment


Field Summary
 java.util.HashMap func
           
 
Constructor Summary
DefaultEnvironment()
           
 
Method Summary
 void bindFunction(ScriptInstance si, java.lang.String type, java.lang.String name, Block code)
          binds a function (functionName) of a certain type (typeKeyword) to the defined functionBody.
protected  BasicSubroutine getNextSafeSubroutine(BasicSubroutine function)
           
 boolean scriptLoaded(ScriptInstance si)
          called when a script is loaded
 boolean scriptUnloaded(ScriptInstance si)
          called when a script is unloaded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

func

public java.util.HashMap func
Constructor Detail

DefaultEnvironment

public DefaultEnvironment()
Method Detail

scriptUnloaded

public boolean scriptUnloaded(ScriptInstance si)
Description copied from interface: Loadable
called when a script is unloaded

Specified by:
scriptUnloaded in interface Loadable

getNextSafeSubroutine

protected BasicSubroutine getNextSafeSubroutine(BasicSubroutine function)

scriptLoaded

public boolean scriptLoaded(ScriptInstance si)
Description copied from interface: Loadable
called when a script is loaded

Specified by:
scriptLoaded in interface Loadable

bindFunction

public void bindFunction(ScriptInstance si,
                         java.lang.String type,
                         java.lang.String name,
                         Block code)
Description copied from interface: Environment
binds a function (functionName) of a certain type (typeKeyword) to the defined functionBody.

Specified by:
bindFunction in interface Environment
type - the keyword for the function. (i.e. sub)
name - the function name (i.e. add)
code - the compiled body of the function (i.e. code to add 2 numbers)