OCLOperators select
(Updated Edited template to July 12, 2025.) |
No edit summary |
||
Line 6: | Line 6: | ||
!Result | !Result | ||
|- | |- | ||
|<nowiki>Sequence{1, 2, 3}->select( | |<nowiki>Sequence{1, 2, 3}->select(i| i > 1)</nowiki> | ||
|Sequence{2, 3} | |Sequence{2, 3} | ||
|- | |- | ||
|<nowiki>Bag{1, 2, 3}->select( | |<nowiki>Bag{1, 2, 3}->select(i| i > 1 )</nowiki> | ||
|Bag{3, 2} | |Bag{3, 2} | ||
|- | |- | ||
|<nowiki> | |<nowiki>Set{1, 2, 3}->select(i| i > 1 )</nowiki> | ||
|Set{3, 2} | |Set{3, 2} | ||
|} | |} | ||
[[Category:OCL Collection Operators]] | [[Category:OCL Collection Operators]] | ||
{{Edited|July|12|2025}} | {{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 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} |