OCL Operators flatten
From MDrivenWiki
flatten () : Collection(T2)
Returns a collection containing all elements of self recursively flattened. Note: at the time of writing, the OCL standard library sports a bug that changes *OrderedSets* in *Sets* when flattening.
Expression | Result |
---|---|
Sequence{Set{1, 2, 3}, Sequence{2.0, 3.0}, Bag{'test'}}->flatten() | Sequence{1, 2, 3, 2.0, 3.0, 'test'} |
Bag{Set{Bag{'test', 2, 3.0}}, Sequence{OrderedSet{2.0, 3, 1}}}->flatten() | Bag{1, 2, 3, 2.0, 3.0, 'test'} |
OrderedSet{Set{Bag{'test', 2, 3.0}}, Sequence{Set{2.0, 3, 1}}}->flatten() | Set{3.0, 2, 1, 3, 'test', 2.0} |
Set{Set{Bag{'test', 2, 3.0}}, Sequence{OrderedSet{2.0, 3, 1}}}->flatten() | Set{3.0, 2, 1, 3, 'test', 2.0} |