Interface IVariableCollection

  • All Known Implementing Classes:
    VariableCollection

    public interface IVariableCollection
    Defines a variables list.
    • Method Summary

      Modifier and Type Method Description
      void add​(IVariable variable)
      Adds a new variable to the collection.
      void clear()
      Clears the collection.
      void clearValues()
      Clears all stored variables (assigns null values).
      IVariable findByName​(String name)
      Finds variable in the list by it's name.
      int findIndexByName​(String name)
      Finds variable index in the list by it's name.
      IVariable get​(int index)
      Get a variable by its index.
      List<IVariable> getAll()
      Get all variables stores in the collection
      int length()
      Gets a number of variables stored in the collection.
      IVariable locate​(String name)
      Finds variable in the list or create a new one if variable was not found.
      void remove​(int index)
      Removes a variable by its index.
      void removeByName​(String name)
      Removes variable by it's name.
    • Method Detail

      • add

        void add​(IVariable variable)
        Adds a new variable to the collection.
        Parameters:
        variable - a variable to be added.
      • length

        int length()
        Gets a number of variables stored in the collection.
        Returns:
        a number of stored variables.
      • get

        IVariable get​(int index)
        Get a variable by its index.
        Parameters:
        index - a variable index.
        Returns:
        a retrieved variable.
      • getAll

        List<IVariable> getAll()
        Get all variables stores in the collection
        Returns:
        a list with variables.
      • findIndexByName

        int findIndexByName​(String name)
        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.
      • findByName

        IVariable findByName​(String name)
        Finds variable in the list by it's name.
        Parameters:
        name - The variable name to be found.
        Returns:
        A variable or null if function was not found.
      • locate

        IVariable locate​(String name)
        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.
      • remove

        void remove​(int index)
        Removes a variable by its index.
        Parameters:
        index - a index of the variable to be removed.
      • removeByName

        void removeByName​(String name)
        Removes variable by it's name.
        Parameters:
        name - The variable name to be removed.
      • clear

        void clear()
        Clears the collection.
      • clearValues

        void clearValues()
        Clears all stored variables (assigns null values).