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.Hashtablevalues
-
Constructor Summary
Constructors Constructor Description DefaultVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariablecreateInternalVariableContainer()returns which variable environment is used to store non-global / non-local variables.VariablecreateLocalVariableContainer()returns which variable environment is used to temporarily store local variables.ScalargetScalar(java.lang.String key)returns the specified scalar, if scalarExists says it is in the environment, this method has to return a scalarScalarputScalar(java.lang.String key, Scalar value)put a scalar into this variable environmentvoidremoveScalar(java.lang.String key)remove a scalar from this variable environmentbooleanscalarExists(java.lang.String key)true if a scalar named key exists in this variable environmentvoidscriptLoaded(ScriptInstance script)called when a script is loadedvoidscriptUnloaded(ScriptInstance script)called when a script is unloaded
-
-
-
Method Detail
-
scalarExists
public boolean scalarExists(java.lang.String key)
Description copied from interface:Variabletrue if a scalar named key exists in this variable environment- Specified by:
scalarExistsin interfaceVariable
-
getScalar
public Scalar getScalar(java.lang.String key)
Description copied from interface:Variablereturns 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:Variableput a scalar into this variable environment
-
removeScalar
public void removeScalar(java.lang.String key)
Description copied from interface:Variableremove a scalar from this variable environment- Specified by:
removeScalarin interfaceVariable
-
createLocalVariableContainer
public Variable createLocalVariableContainer()
Description copied from interface:Variablereturns which variable environment is used to temporarily store local variables.- Specified by:
createLocalVariableContainerin interfaceVariable
-
createInternalVariableContainer
public Variable createInternalVariableContainer()
Description copied from interface:Variablereturns 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:
createInternalVariableContainerin interfaceVariable
-
scriptLoaded
public void scriptLoaded(ScriptInstance script)
Description copied from interface:Loadablecalled when a script is loaded- Specified by:
scriptLoadedin interfaceLoadable
-
scriptUnloaded
public void scriptUnloaded(ScriptInstance script)
Description copied from interface:Loadablecalled when a script is unloaded- Specified by:
scriptUnloadedin interfaceLoadable
-
-