OCLOperators append
No edit summary
No edit summary
Line 11: Line 11:
Note! Append does NOT change the "source" sequence. If you want to add an object to an association, use [[OCLOperators add|.add]]
Note! Append does NOT change the "source" sequence. If you want to add an object to an association, use [[OCLOperators add|.add]]


The opposite, excluding an object from an collection without changing the "source" collection, use [[OCLOperators excluding|excluding]].
The opposite, excluding an object from a collection without changing the "source" collection - use [[OCLOperators excluding|excluding]].
[[Category:OCLOperators]]
[[Category:OCLOperators]]
[[Category:OCL Collection Operators]]

Revision as of 06:10, 13 April 2023

->append ( object : T ) : Sequence(T)

Returns a Sequence containing all elements of self followed by object.

Expression Result
Sequence{'a', 'b'}->append('c') Sequence{'a', 'b', 'c'}

Note! Append does NOT change the "source" sequence. If you want to add an object to an association, use .add

The opposite, excluding an object from a collection without changing the "source" collection - use excluding.

This page was edited 87 days ago on 02/10/2024. What links here