OCLOperators excluding
(Automatically adding template at the end of the page.)
(Adding message template to the top of the page)
Line 1: Line 1:
{{message|Write the content here to display this box}}
=== excluding ( object : T ) : Collection(T) ===
=== excluding ( object : T ) : Collection(T) ===
Returns a collection containing all elements of ''self'' minus all occurrences of ''object''. '''Note:''' at the time of writing, the OCL standard library sports a bug that changes *OrderedSets* in *Sets* when excluding elements.
Returns a collection containing all elements of ''self'' minus all occurrences of ''object''. '''Note:''' at the time of writing, the OCL standard library sports a bug that changes *OrderedSets* in *Sets* when excluding elements.

Revision as of 22:24, 16 June 2024

Write the content here to display this box

excluding ( object : T ) : Collection(T)

Returns a collection containing all elements of self minus all occurrences of object. Note: at the time of writing, the OCL standard library sports a bug that changes *OrderedSets* in *Sets* when excluding elements.

Expression Result
Sequence{'b', 'a', 'b', 'c'}->excluding('b') Sequence{'a', 'c'}
Bag{'b', 'a', 'b', 'c'}->excluding('b') Bag{'c', 'a'}
OrderedSet{'b', 'a', 'b', 'c'}->excluding('b') Set{'c', 'a'}
Set{'b', 'a', 'b', 'c'}->excluding('b') Set{'c', 'a'}

The opposite - to add an object to a collection - is Append.

This page was edited 95 days ago on 06/17/2024. What links here