Methods

The functional description of a software model in ESDL is contained in methods. The methods perform calculations and manipulate data. They are invoked (or called) as operations on objects.

A method call has the general form

receiverClassName.doSomething(parameterList);

where receiverClassName is the name of the receiver object, which ’executes’ the doSomething method. Parameters can be passed on as either a comma-separated list or a single parameter in the parameterList. Any expression can be a parameter, including method calls.

The following are valid method calls in ESDL.

If a method has no parameters, the parentheses at the end of the method name still have to be supplied for the statement to be interpreted as a method call.

loader.resolve(false, 1.76);
//don't use characteristic, calculate value for 1.76

numbers.setAt(10*index, index);
//set array numbers to 10*index at index

(12.4)between(valA, valB);
//check if 12.4 is between valA and valB

array.length();
//return array length

Note

Access to the length of an array or matrix via length() is not supported for microcontroller targets.

See also

Methods with a Return Value

Nested Methods

This

Access Control

Direct Access Methods

Primitive Methods

Conversion of Methods or Processes

Methods Without Side Effects