OCLOperators count
(Created page with "Count how many meet a certain criteria")
 
(Automatically adding template at the end of the page.)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Count how many meet a certain criteria
=== count ( object : T ) : Integer ===
Returns how many times ''object'' is in the collection ''self''.
{| class="wikitable"
!Expression
!Result
|-
|Sequence{2.3, 5.2}->count(5.2)
|1
|-
|Set{3, 'test', 4.0, 4, 4.0, 'test'}->count(null)
|0
|-
|Set{3, null, 4.0, null, 'test'}->count(null)
|1
|-
|Bag{3, null, 4.0, null, 'test'}->count(null)
|2
|}
[[Category:OCL Collection Operators]]
[[Category:OCL General Operators]]
{{Edited|July|12|2024}}

Latest revision as of 15:41, 10 February 2024

count ( object : T ) : Integer

Returns how many times object is in the collection self.

Expression Result
Sequence{2.3, 5.2}->count(5.2) 1
Set{3, 'test', 4.0, 4, 4.0, 'test'}->count(null) 0
Set{3, null, 4.0, null, 'test'}->count(null) 1
Bag{3, null, 4.0, null, 'test'}->count(null) 2
This page was edited 95 days ago on 02/10/2024. What links here