OCLOperators append
Denis Pupin (talk | contribs) No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=== ->append ( object : T ) : Sequence(T) === | |||
[[Category: | Returns a Sequence containing all elements of ''self'' followed by ''object''. | ||
{| class="wikitable" | |||
!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 [[OCLOperators add|.add]] | |||
The opposite, excluding an object from a collection without changing the "source" collection - use [[OCLOperators excluding|excluding]]. | |||
[[Category:OCL Collection Operators]] |
Revision as of 05:59, 18 April 2023
This page was created by Alexandra on 2017-08-13. Last edited by Edgar on 2025-08-22.
->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.