VariableMap class
Class for a variable map. This contains a dictionary data structure with variable types as keys and lists of variables as values. The list of variables are the type indicated by the key.
Signature:
export declare class VariableMap implements IVariableMap<IVariableModel<IVariableState>>
Implements: IVariableMap<IVariableModel<IVariableState>>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(workspace, potentialMap) | Constructs a new instance of the VariableMap class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
potentialMap | boolean | ||
workspace | Workspace |
Methods
Method | Modifiers | Description |
---|---|---|
addVariable(variable) | Adds the given variable to this variable map. | |
changeVariableType(variable, newType) | ||
clear() | Clear the variable map. Fires events for every deletion. | |
createVariable(name, opt_type, opt_id) | Create a variable with a given name, optional type, and optional ID. | |
deleteVariable(variable) | Delete a variable and all of its uses without confirmation. | |
deleteVariableById(id) | Delete a variables by the passed in ID and all of its uses from this workspace. May prompt the user for confirmation. | |
getAllVariableNames() | Returns all of the variable names of all types. | |
getAllVariables() | Return all variables of all types. | |
getTypes() | Returns a list of unique types of variables in this variable map. | |
getVariable(name, opt_type) | Find the variable by the given name and type and return it. Return null if it is not found. | |
getVariableById(id) | Find the variable by the given ID and return it. Return null if not found. | |
getVariablesOfType(type) | Get a list containing all of the variables of a specified type. If type is null, return list of variables with empty string type. | |
getVariableUsesById(id) | Find all the uses of a named variable. | |
renameVariable(variable, newName) | Rename the given variable by updating its name in the variable map. | |
renameVariableById(id, newName) | Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID. |