Package com.singularsys.jep.misc
Class CaseInsensitiveVariableTable
java.lang.Object
com.singularsys.jep.VariableTable
com.singularsys.jep.misc.DecoratingVariableTable
com.singularsys.jep.misc.CaseInsensitiveVariableTable
- All Implemented Interfaces:
JepComponent,Serializable
A Variable table which ignores case.
Internally variable names are converted to lowercase.
- Author:
- Richard Morris
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.VariableTable
table, vf -
Constructor Summary
ConstructorsConstructorDescriptionCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionaddConstant(String name, Object value) Adds a new constantaddVariable(String name) Adds a new variable with no value specified.addVariable(String name, Object value) Adds a new variable with specified value.static CaseInsensitiveVariableTableCreate a decorator instanceReturns a new empty VariableTable.getVariable(String name) Gets an existing variable, returns null if variable is not found.Remove a variable with a given name from the table.Methods inherited from class com.singularsys.jep.misc.DecoratingVariableTable
clear, clearValues, containsKey, containsVariable, copyConstantsFrom, copyVariablesFrom, getBase, getVariableFactory, getVariables, init, isEmpty, keySet, remove, removeNonConstants, setVariableFactory, size, toString, values
-
Constructor Details
-
CaseInsensitiveVariableTable
public CaseInsensitiveVariableTable() -
CaseInsensitiveVariableTable
Copy constructor- Parameters:
tbl- table to copy variables from
-
-
Method Details
-
decoratorInstance
Create a decorator instance- Parameters:
tbl- the base table- Returns:
- a new instance
-
addVariable
Adds a new variable with no value specified.- Overrides:
addVariablein classDecoratingVariableTable- Parameters:
name- variable name, will be converted to lower case- Returns:
- the variable
-
addConstant
Adds a new constant- Overrides:
addConstantin classDecoratingVariableTable- Parameters:
name- variable name, will be converted to lower casevalue- variable value- Returns:
- the variable
- Throws:
JepException- if an attempt is made to set the value of an existing constant variable
-
addVariable
Adds a new variable with specified value.- Overrides:
addVariablein classDecoratingVariableTable- Parameters:
name- variable name, will be converted to lower casevalue- initial value- Returns:
- the variable
- Throws:
JepException- if an attempt is made to set the value of a constant variable
-
getVariable
Gets an existing variable, returns null if variable is not found.- Overrides:
getVariablein classDecoratingVariableTable- Parameters:
name- variable name, will be converted to lower case- Returns:
- the variable
-
remove
Description copied from class:VariableTableRemove a variable with a given name from the table.- Overrides:
removein classDecoratingVariableTable- Parameters:
name- name of the variable to remove- Returns:
- the removed variable or null if the variable does not exist in the table.
-
getLightWeightInstance
Description copied from class:VariableTableReturns a new empty VariableTable.- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classDecoratingVariableTable- Returns:
- a new VariableTable
- See Also:
-