Description
The IVariableCollection interface defines a list of variables.
Instance methods
add
Adds a new variable to the collection.
void add(IVariable variable)
- variable: IVariable - variable to be added.
clear
Clears the collection.
void clear()
clearValues
Clears all stored variables (assigns null values).
void clearValues()
findByName
Finds variable in the list by it’s name.
IVariable findByName(String name)
- name: string - The variable name to be found.
- returns: IVariable - Variable or null if function was not found.
findIndexByName
Finds a variable index in the list by the variable’s name.
int findIndexByName(String name)
- name: String - name of the variable to be found.
- returns: int - variable index in the list or -1 if variable was not found.
get
Gets a variable by its index.
IVariable get(int index)
- index: int - variable index.
- returns: IVariable - retrieved variable.
getAll
Gets all the variables stored in the collection.
List<IVariable[]> getAll()
- returns: List<IVariable[]> - list with stored variables.
length
Gets a number of variables stored in the collection.
int length()
- returns: int - number of stored variables.
locate
Finds a variable in the list or creates a new one if the variable was not found.
IVariable locate(String name)
- name: String - name of the variable to be found.
- returns: IVariable - found or created variable.
remove
Removes a variable by its index.
void remove(int index)
- index: int - index of the variable to be removed.
removeByName
Removes a variable by it’s name.
void removeByName(String name)
- name: String - name of the variable to be removed.