OCLOperators foreach
No edit summary
(Automatically adding template at the end of the page.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Note: This is an EAL operator'''
'''Note: This is an EAL operator'''


Interates 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
Line 9: Line 9:
|The method DoSomething is called once on each of the objects in (list of objects)
|The method DoSomething is called once on each of the objects in (list of objects)
|}
|}
For iterating and returning a list as the result, use [[OCLOperators collect|collect]]
To iterate and return a list as the result, use [[OCLOperators collect|collect]].
[[Category:OCLOperators]]
[[Category:OCLOperators]]
[[Category:EAL]]
{{Edited|July|12|2024}}

Latest revision as of 15:41, 10 February 2024

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