Class FunctionCollection

    • Constructor Detail

      • FunctionCollection

        public FunctionCollection()
    • Method Detail

      • add

        public void add​(IFunction func)
        Adds a new function to the collection.
        Specified by:
        add in interface IFunctionCollection
        Parameters:
        func - a function to be added.
      • length

        public int length()
        Gets a number of functions stored in the collection.
        Specified by:
        length in interface IFunctionCollection
        Returns:
        a number of stored functions.
      • get

        public IFunction get​(int index)
        Get a function by its index.
        Specified by:
        get in interface IFunctionCollection
        Parameters:
        index - a function index.
        Returns:
        a retrieved function.
      • findIndexByName

        public int findIndexByName​(String name)
        Finds function index in the list by it's name.
        Specified by:
        findIndexByName in interface IFunctionCollection
        Parameters:
        name - The function name to be found.
        Returns:
        Function index in the list or -1 if function was not found.
      • findByName

        public IFunction findByName​(String name)
        Finds function in the list by it's name.
        Specified by:
        findByName in interface IFunctionCollection
        Parameters:
        name - The function name to be found.
        Returns:
        A function or null if function was not found.
      • remove

        public void remove​(int index)
        Removes a function by its index.
        Specified by:
        remove in interface IFunctionCollection
        Parameters:
        index - a index of the function to be removed.
      • removeByName

        public void removeByName​(String name)
        Removes function by it's name.
        Specified by:
        removeByName in interface IFunctionCollection
        Parameters:
        name - The function name to be removed.