pip_services3_expressions.calculator.variables.VariableCollection module
-
class
pip_services3_expressions.calculator.variables.VariableCollection.
VariableCollection
Bases:
pip_services3_expressions.calculator.variables.IVariableCollection.IVariableCollection
Implements a variables list.
-
add
(variable: pip_services3_expressions.calculator.variables.IVariable.IVariable) Adds a new variable to the collection.
- Parameters
variable – a variable to be added.
-
clear
() Clears the collection.
-
clear_values
() Clears all stored variables (assigns null values).
-
find_by_name
(name: str) → pip_services3_expressions.calculator.variables.IVariable.IVariable Finds variable in the list by it’s name.
- Parameters
name – The variable name to be found.
- Returns
A variable or None if function was not found.
-
find_index_by_name
(name: str) → int Finds variable index in the list by it’s name.
- Parameters
name – The variable name to be found.
- Returns
Variable index in the list or -1 if variable was not found.
-
get
(index: int) → pip_services3_expressions.calculator.variables.IVariable.IVariable Get a variable by its index.
- Parameters
index – a variable index.
- Returns
a retrieved variable.
-
get_all
() → List[pip_services3_expressions.calculator.variables.IVariable.IVariable] Get all variables stores in the collection
- Returns
a list with variables.
-
property
length
Gets a number of variables stored in the collection.
- Returns
a number of stored variables.
-
locate
(name: str) → pip_services3_expressions.calculator.variables.IVariable.IVariable Finds variable in the list or create a new one if variable was not found.
- Parameters
name – The variable name to be found.
- Returns
Found or created variable.
-