IFunctionCollection

Implements a list of functions.

Description

The IFunctionCollection class allows you to create a list of functions.

Properties

length

Gets the number of functions stored in the collection.

int length()

  • retuns: int - number of stored functions.

Instance methods

add

Adds a new function to the collection.

void add(IFunction func)

  • func: IFunction - an array with function parameters.

clear

Clears the collection.

void clear()

findByName

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

IFunction findByName(String name)

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

findIndexByName

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

int findIndexByName(String name)

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

get

Gets a function by its index.

IFunction get(int index)

  • int: number - function index.
  • returns: IFunction - retrieved function.

getAll

Gets all functions stores in the collection.

List<IFunction[]> getAll()

remove

Removes a function by its index.

void remove(int index)

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

removeByName

Removes a function by its name.

void removeByName(String name)

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