public class VariableFactory extends java.lang.Object implements JepComponent
Variable
.
This class should be sub-classed if the type of variable used needs to be
changed.
This class is passed to the constructor of VariableTable
which ensures that variables of the correct type are always created.
This class should only be called from the VariableTable class and not from application code.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
defaultValue
The default value to use when variable is created with no value
|
Constructor and Description |
---|
VariableFactory() |
Modifier and Type | Method and Description |
---|---|
Variable |
copyVariable(Variable var)
Create a new variable which is a copy of this one.
|
Variable |
createVariable(java.lang.String name)
Create a variable with a name but not value
|
Variable |
createVariable(java.lang.String name,
java.lang.Object value)
Create a variable with a name and value.
|
java.lang.Object |
getDefaultValue() |
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
void |
init(Jep j)
Initialize the component.
|
void |
setDefaultValue(java.lang.Object defaultValue)
Sets the default value used whenever a new variable is created.
|
protected java.lang.Object defaultValue
public void init(Jep j)
JepComponent
init
in interface JepComponent
j
- the current Jep instancepublic Variable createVariable(java.lang.String name, java.lang.Object value)
name
- name of variablevalue
- initial valuepublic Variable createVariable(java.lang.String name)
name
- name of variablepublic Variable copyVariable(Variable var)
public java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object defaultValue)
defaultValue
- The defaultValue to set.public JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
Copyright © 2018 Singular Systems http://www.singularsys.com/jep