OCLOperators intersection
m ((username removed) (log details removed): Moving to Documentation namespace)
(Automatically adding template at the end of the page.)
Line 16: Line 16:
[[File:2019-11-25 13h29 19.png|none|thumb]]See: [[Examples_on_collection_operators]]
[[File:2019-11-25 13h29 19.png|none|thumb]]See: [[Examples_on_collection_operators]]
[[Category:OCL Collection Operators]]
[[Category:OCL Collection Operators]]
{{Edited|July|12|2024}}

Revision as of 15:42, 10 February 2024

This page was created by Alexandra on 2017-08-13. Last edited by Stephanie@mdriven.net on 2025-01-23.

intersection ( bag : Bag(T) ) : Bag(T)

Returns a Bag containing all elements of self that are also contained by *bag*.

Expression Result
Bag{'a', 'b', 'a'}->intersection(Bag{'a', 'b'}) Bag{'a', 'b'}
Bag{'a', 'b', 'a', 'b'}->intersection(Bag{'a', 'b', 'b'}) Bag{'b', 'a', 'b'}
Set{1,2,3}->intersection(Set{2,3,4}) Set{2,3}
2019-11-25 13h29 19.png

See: Examples_on_collection_operators