Documentation ¶
Index ¶
- type IVariable
- type IVariableCollection
- type Variable
- type VariableCollection
- func (c *VariableCollection) Add(variable IVariable)
- func (c *VariableCollection) Clear()
- func (c *VariableCollection) ClearValues()
- func (c *VariableCollection) FindByName(name string) IVariable
- func (c *VariableCollection) FindIndexByName(name string) int
- func (c *VariableCollection) Get(index int) IVariable
- func (c *VariableCollection) GetAll() []IVariable
- func (c *VariableCollection) Length() int
- func (c *VariableCollection) Locate(name string) IVariable
- func (c *VariableCollection) Remove(index int)
- func (c *VariableCollection) RemoveByName(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IVariable ¶
type IVariable interface { // The variable name. Name() string // Gets the variable value. Value() *variants.Variant // Sets the variable value. SetValue(value *variants.Variant) }
Defines a variable interface.
type IVariableCollection ¶
type IVariableCollection interface { // Adds a new variable to the collection. // // Parameters: // - variable: a variable to be added. Add(variable IVariable) // A number of variables stored in the collection. Length() int // Get a variable by its index. // // Parameters: // - index: a variable index. // Returns: a retrieved variable. Get(index int) IVariable // Get all variables stores in the collection // Returns: a list with variables. GetAll() []IVariable // 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 <code>-1</code> if variable was not found. FindIndexByName(name string) int // Finds variable in the list by it's name. // // Parameters: // - name: The variable name to be found. // Returns: Variable or <code>null</code> if function was not found. FindByName(name string) 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. Locate(name string) IVariable // Removes a variable by its index. // // Parameters: // - index: a index of the variable to be removed. Remove(index int) // Removes variable by it's name. // // Parameters: // - name: The variable name to be removed. RemoveByName(name string) // Clears the collection. Clear() // Clears all stored variables (assigns null values). ClearValues() }
Defines a variables list.
type Variable ¶
type Variable struct {
// contains filtered or unexported fields
}
Implements a variable holder object.
func NewVariable ¶
Constructs this variable with name and value.
Parameters:
- name: The name of this variable.
- value: The variable value.
type VariableCollection ¶
type VariableCollection struct {
// contains filtered or unexported fields
}
Implements a variables list.
func NewVariableCollection ¶
func NewVariableCollection() *VariableCollection
func (*VariableCollection) Add ¶
func (c *VariableCollection) Add(variable IVariable)
Adds a new variable to the collection.
Parameters:
- variable: a variable to be added.
func (*VariableCollection) ClearValues ¶
func (c *VariableCollection) ClearValues()
Clears all stored variables (assigns null values).
func (*VariableCollection) FindByName ¶
func (c *VariableCollection) FindByName(name string) IVariable
Finds variable in the list by it's name.
Parameters:
- name: The variable name to be found.
Returns: Variable or <code>null</code> if function was not found.
func (*VariableCollection) FindIndexByName ¶
func (c *VariableCollection) FindIndexByName(name string) 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 <code>-1</code> if variable was not found.
func (*VariableCollection) Get ¶
func (c *VariableCollection) Get(index int) IVariable
Get a variable by its index.
Parameters:
- index: a variable index.
Returns: a retrieved variable.
func (*VariableCollection) GetAll ¶
func (c *VariableCollection) GetAll() []IVariable
Get all variables stores in the collection
Returns: a list with variables.
func (*VariableCollection) Length ¶
func (c *VariableCollection) Length() int
A number of variables stored in the collection.
func (*VariableCollection) Locate ¶
func (c *VariableCollection) Locate(name string) 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.
func (*VariableCollection) Remove ¶
func (c *VariableCollection) Remove(index int)
Removes a variable by its index.
Parameters:
- index: a index of the variable to be removed.
func (*VariableCollection) RemoveByName ¶
func (c *VariableCollection) RemoveByName(name string)
Removes variable by it's name.
Parameters:
- name: The variable name to be removed.