FunctionCollection

Implements a list of functions.

Implements: IFunctionCollection

Description

The FunctionCollection class allows you to implement a list of functions

Instance methods

length

Gets the number of functions stored in the collection.

int length()

  • retuns: int - number of stored functions.

add

Adds a new function to the collection.

public void add(IFunction func)

  • func: IFunction - array with function parameters.

clear

Clears the collection.

public void clear()

findByName

Finds a function in the list by it’s name.

public IFunction findByName(String name)

  • name: String - function name to be found.
  • returns: IFunction - function or null if no function was not found.

findIndexByName

Finds a function’s index in the list by it’s name.

public int findIndexByName(String name)

  • name: String - function name to be found.
  • returns: int - function’s index in the list or -1 if nofunction was not found.

get

Gets a function by its index.

public IFunction get(int index)

  • index: int - function’s index.
  • returns: IFunction - retrieved function.

getAll

Gets all functions stored in the collection.

public List<IFunction[]> getAll()

remove

Removes a function by its index.

public void remove(int index)

  • index: int - index of the function to be removed.

removeByName

Removes a function by its name.

public void removeByName(String name)

  • name: String - name of the function to be removed.