OCLOperators foreach
(Created page with "Interates a collection containing and applying ''expr'' on all elements contained in ''self''. {| class="wikitable" !Expression !Result |- |<nowiki>(list of objects)->forEa...")
 
No edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Interates a collection containing and applying ''expr'' on all elements contained in ''self''.
<message>Write the content here to display this box</message>
'''Note: This is an EAL operator'''
 
It iterates a collection containing and executing the expression on all elements contained in ''self''.
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression
Line 7: Line 10:
|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)
|}
|}
To iterate and return a list as the result, use [[Documentation:OCLOperators collect|collect]].
[[Category:OCLOperators]]
[[Category:EAL]]
{{Edited|July|12|2025}}
[[Category:OCL Collection Operators]]

Latest revision as of 05:07, 11 February 2025

This page was created by Lars.olofsson@mdriven.net on 2021-12-13. Last edited by Stephanie@mdriven.net on 2025-02-11.

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.