Class BoundVariableFactory
java.lang.Object
com.singularsys.jep.VariableFactory
com.singularsys.jep.misc.boundvariable.BoundVariableFactory
- All Implemented Interfaces:
JepComponent,Serializable
A variable factory for creating bound variables.
If a variable is called with an VariableBinding as its value then
a BoundVariable will be created.
- Since:
- Jep 3.5
- Author:
- Richard Morris
- See Also:
-
Field Summary
FieldsFields inherited from class com.singularsys.jep.VariableFactory
defaultValue -
Constructor Summary
ConstructorsConstructorDescriptionCreate the factory with no VariableMapping.Create the factory with a specific VariableMapping for creation of new variables. -
Method Summary
Modifier and TypeMethodDescriptioncreateVariable(String name) Create a variable with a name but not value CallsVariableFactory.createVariable(String, Object)so subclasses need not override this method.createVariable(String name, VariableBinding vb) Creates a variable with the given VariableBindingcreateVariable(String name, Object value) If the value is an instance ofVariableBindingthen call thecreateVariable(String, VariableBinding)method, otherwise treat as normal.Gets the VariableMapping for the creation of new variables.voidSets the VariableMapping for the creation of new variables.Methods inherited from class com.singularsys.jep.VariableFactory
copyVariable, getDefaultValue, getLightWeightInstance, init, setDefaultValue
-
Field Details
-
vbm
-
-
Constructor Details
-
BoundVariableFactory
public BoundVariableFactory()Create the factory with no VariableMapping. When a new variable is requested -
BoundVariableFactory
Create the factory with a specific VariableMapping for creation of new variables.- Parameters:
vbm- the mapping class translates a specific jep variable names to particular objects
-
-
Method Details
-
createVariable
Description copied from class:VariableFactoryCreate a variable with a name but not value CallsVariableFactory.createVariable(String, Object)so subclasses need not override this method.- Overrides:
createVariablein classVariableFactory- Parameters:
name- name of variable- Returns:
- reference to Variable object
-
createVariable
If the value is an instance ofVariableBindingthen call thecreateVariable(String, VariableBinding)method, otherwise treat as normal.- Overrides:
createVariablein classVariableFactory- Parameters:
name- variable namevalue- either the initial value or a VariableBinding object- Returns:
- the created variable
-
createVariable
Creates a variable with the given VariableBinding- Parameters:
name- name of the variablevb- binding object- Returns:
- a new BoundVariable
-
getVariableMapping
Gets the VariableMapping for the creation of new variables.- Returns:
- the mapping used or null if none set.
-
setVariableMapping
Sets the VariableMapping for the creation of new variables.- Parameters:
vm- the mapping
-