Package gov.nih.mipav.model.scripting
Class VariableTable
java.lang.Object
java.util.Dictionary
java.util.Hashtable
gov.nih.mipav.model.scripting.VariableTable
- All Implemented Interfaces:
Serializable,Cloneable,Map
A table used to store variables and their values.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longUse serialVersionUID for interoperability.protected static VariableTableThe reference to the only VariableTable which should ever be instantiated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final VariableTableReturns a reference to the variable table singleton.interpolate(String varName) Interpolates and returns the value of a given variable.booleanisVariableSet(String varName) Checks to see if a variable has been added to the variable table.voidremoveVariable(String varName) Removes a variable and its value from the variable table.voidstoreVariable(String varName, String value) Stores a variable name and its value in the variable table.Methods inherited from class java.util.Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
singletonReference
The reference to the only VariableTable which should ever be instantiated.
-
-
Constructor Details
-
VariableTable
protected VariableTable()Creates a new VariableTable object.
-
-
Method Details
-
getReference
Returns a reference to the variable table singleton.- Returns:
- A reference to the variable table.
-
interpolate
Interpolates and returns the value of a given variable.- Parameters:
varName- The name of the variable to interpolate.- Returns:
- The variable's value.
-
isVariableSet
Checks to see if a variable has been added to the variable table.- Parameters:
varName- The name of the variable to check for.- Returns:
Trueif the variable has been added to the table,falseotherwise.
-
removeVariable
Removes a variable and its value from the variable table.- Parameters:
varName- The name of the variable to remove.
-
storeVariable
Stores a variable name and its value in the variable table.- Parameters:
varName- The name of the variable (e.g., '$save_as_file_name').value- The variable value.
-