OCLOperators select
(Created page with "Returns the objects matching the criteria")
 
No edit summary
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Returns the objects matching the criteria
<message>Write the content here to display this box</message>
=== select ( expr : OclExpression ) : Collection(T) ===
Returns a collection with all elements of ''self'' that validate the OclExpression ''expr''.
{| class="wikitable"
!Expression
!Result
|-
|<nowiki>Sequence{1, 2, 3}->select(i| i > 1)</nowiki>
|Sequence{2, 3}
|-
|<nowiki>Bag{1, 2, 3}->select(i| i > 1 )</nowiki>
|Bag{3, 2}
|-
|<nowiki>Set{1, 2, 3}->select(i| i > 1 )</nowiki>
|Set{3, 2}
|}
[[Category:OCL Collection Operators]]
{{Edited|July|12|2025}}

Latest revision as of 08:05, 12 February 2025

This page was created by Alexandra on 2017-08-13. Last edited by Hans.karlsen@mdriven.net on 2025-02-12.

select ( expr : OclExpression ) : Collection(T)

Returns a collection with all elements of self that validate the OclExpression expr.

Expression Result
Sequence{1, 2, 3}->select(i| i > 1) Sequence{2, 3}
Bag{1, 2, 3}->select(i| i > 1 ) Bag{3, 2}
Set{1, 2, 3}->select(i| i > 1 ) Set{3, 2}
MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments