sleep.bridges
Class DefaultVariable

java.lang.Object
  extended by sleep.bridges.DefaultVariable
All Implemented Interfaces:
java.io.Serializable, Loadable, Variable

public class DefaultVariable
extends java.lang.Object
implements Variable, Loadable

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable values
           
 
Constructor Summary
DefaultVariable()
           
 
Method Summary
 Variable createInternalVariableContainer()
          returns which variable environment is used to store non-global / non-local variables.
 Variable createLocalVariableContainer()
          returns which variable environment is used to temporarily store local variables.
 Scalar getScalar(java.lang.String key)
          returns the specified scalar, if scalarExists says it is in the environment, this method has to return a scalar
 Scalar putScalar(java.lang.String key, Scalar value)
          put a scalar into this variable environment
 void removeScalar(java.lang.String key)
          remove a scalar from this variable environment
 boolean scalarExists(java.lang.String key)
          true if a scalar named key exists in this variable environment
 boolean scriptLoaded(ScriptInstance script)
          called when a script is loaded
 boolean scriptUnloaded(ScriptInstance script)
          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

values

protected java.util.Hashtable values
Constructor Detail

DefaultVariable

public DefaultVariable()
Method Detail

scalarExists

public boolean scalarExists(java.lang.String key)
Description copied from interface: Variable
true if a scalar named key exists in this variable environment

Specified by:
scalarExists in interface Variable

getScalar

public Scalar getScalar(java.lang.String key)
Description copied from interface: Variable
returns the specified scalar, if scalarExists says it is in the environment, this method has to return a scalar

Specified by:
getScalar in interface Variable

putScalar

public Scalar putScalar(java.lang.String key,
                        Scalar value)
Description copied from interface: Variable
put a scalar into this variable environment

Specified by:
putScalar in interface Variable

removeScalar

public void removeScalar(java.lang.String key)
Description copied from interface: Variable
remove a scalar from this variable environment

Specified by:
removeScalar in interface Variable

createLocalVariableContainer

public Variable createLocalVariableContainer()
Description copied from interface: Variable
returns which variable environment is used to temporarily store local variables.

Specified by:
createLocalVariableContainer in interface Variable

createInternalVariableContainer

public Variable createInternalVariableContainer()
Description copied from interface: Variable
returns which variable environment is used to store non-global / non-local variables. this is also used to create the global scope for a forked script environment.

Specified by:
createInternalVariableContainer in interface Variable

scriptLoaded

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

Specified by:
scriptLoaded in interface Loadable

scriptUnloaded

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

Specified by:
scriptUnloaded in interface Loadable