OCLOperators including
(Created page with "Returns the list with the element in the parameter included.")
 
No edit summary
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Returns the list with the element in the parameter included.
 
Returns a collection containing all elements of ''self'' followed by ''object''. **Note** : at the time of writing, the OCL standard library sports a bug which changes *OrderedSets* in *Sets* when including elements.
{| class="wikitable"
!Expression
!Result
|-
|Sequence{'a', 'b'}->including('c')
|Sequence{'a', 'b', 'c'}
|-
|Bag{'a', 'b'}->including('c')
|Bag{'a', 'c', 'b'}
|-
|OrderedSet{'a', 'b'}->including('c')
|Set{'a', 'c', 'b'}
|-
|Set{'a', 'b'}->including('c')
|Set{'a', 'c', 'b'}
|}
[[Category:OCLOperators]]

Revision as of 05:45, 22 November 2019

Returns a collection containing all elements of self followed by object. **Note** : at the time of writing, the OCL standard library sports a bug which changes *OrderedSets* in *Sets* when including elements.

Expression Result
Sequence{'a', 'b'}->including('c') Sequence{'a', 'b', 'c'}
Bag{'a', 'b'}->including('c') Bag{'a', 'c', 'b'}
OrderedSet{'a', 'b'}->including('c') Set{'a', 'c', 'b'}
Set{'a', 'b'}->including('c') Set{'a', 'c', 'b'}
This page was edited 66 days ago on 02/10/2024. What links here