OCLOperators foreach
No edit summary
No edit summary
Line 1: Line 1:
'''Note: This is an EAL operator'''
'''Note: This is an EAL operator'''


Iterates a collection containing and executing the expression on all elements contained in ''self''.
It iterates a collection containing and executing the expression on all elements contained in ''self''.
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression

Revision as of 06:17, 24 October 2023

Note: This is an EAL operator

It iterates a collection containing and executing the expression on all elements contained in self.

Expression Result
(list of objects)->forEach(str | str.DoSomething) The method DoSomething is called once on each of the objects in (list of objects)

To iterate and return a list as the result, use collect.

This page was edited 89 days ago on 02/10/2024. What links here