OCLOperators append
No edit summary
(Automatically adding template at the end of the page.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Add another object last
=== ->append ( object : T ) : Sequence(T) ===
[[Category:OCLOperators]]
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]]
{{Edited|July|12|2024}}

Latest revision as of 15:40, 10 February 2024

->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 96 days ago on 02/10/2024. What links here