User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:08_object:04_generator:03_array_generator

Array Generator

The array generator a[:] is a generator expression which yields all values of the elements of the array a, starting with the element at index 0.

For the purpose of for loops, there is no need for such an expression because the Java programming language already defines the syntax for (int v : a) {…}. But it is useful for implicit loops such as System.out.println(a[:]); which prints all elements, or in combination with aggregate methods as in sum(Math.abs(a[:])).

The expression a may also denote a generator function with void parameter, i. e., an instance of the interfaces VoidToBooleanGenerator, …, VoidToObjectGenerator. In this case, the generator methods evaluateBoolean, …, evaluateObject, respectively, are invoked.

01_user_documentation/07_rgg_xl/02_xl/08_object/04_generator/03_array_generator.txt · Last modified: 2025/08/20 10:32 by gaetan