FunctionCollection

Implements a list of functions.

Implements: IFunctionCollection

Description

The FunctionCollection class allows you to implement a list of functions

Properties

length

Gets the number of functions stored in the collection.

@override

int get length

  • retuns: int - number of stored functions.

Instance methods

add

Adds a new function to the collection.

@override

void add(IFunction? func)

  • func: IFunction? - array with function parameters.

clear

Clears the collection.

@override

void clear()

findByName

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

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.

@override

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.

IFunction get(int index)

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

getAll

Gets all functions stored in the collection.

@override

List<IFunction> getAll()

remove

Removes a function by its index.

@override

void remove(int index)

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

removeByName

Removes a function by its name.

@override

void removeByName(String name)

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