Package sleep.bridges
Class DefaultVariable
- java.lang.Object
-
- sleep.bridges.DefaultVariable
-
public class DefaultVariable extends java.lang.Object implements Variable, Loadable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Hashtable
values
-
Constructor Summary
Constructors Constructor Description DefaultVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 scalarScalar
putScalar(java.lang.String key, Scalar value)
put a scalar into this variable environmentvoid
removeScalar(java.lang.String key)
remove a scalar from this variable environmentboolean
scalarExists(java.lang.String key)
true if a scalar named key exists in this variable environmentvoid
scriptLoaded(ScriptInstance script)
called when a script is loadedvoid
scriptUnloaded(ScriptInstance script)
called when a script is unloaded
-
-
-
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 interfaceVariable
-
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
-
putScalar
public Scalar putScalar(java.lang.String key, Scalar value)
Description copied from interface:Variable
put a scalar into this variable environment
-
removeScalar
public void removeScalar(java.lang.String key)
Description copied from interface:Variable
remove a scalar from this variable environment- Specified by:
removeScalar
in interfaceVariable
-
createLocalVariableContainer
public Variable createLocalVariableContainer()
Description copied from interface:Variable
returns which variable environment is used to temporarily store local variables.- Specified by:
createLocalVariableContainer
in interfaceVariable
-
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 interfaceVariable
-
scriptLoaded
public void scriptLoaded(ScriptInstance script)
Description copied from interface:Loadable
called when a script is loaded- Specified by:
scriptLoaded
in interfaceLoadable
-
scriptUnloaded
public void scriptUnloaded(ScriptInstance script)
Description copied from interface:Loadable
called when a script is unloaded- Specified by:
scriptUnloaded
in interfaceLoadable
-
-