OCLOperators add
(Created page with "=== .add ( object : T ) === Adds the ''object to'' an sequence, for example an association. {| class="wikitable" !Expression !Result |- |self.<association of type T>.add(<obj...")
 
(Replacing message template with parser tag)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
=== .add ( object : T ) ===
=== .add ( object : T ) ===
Adds the ''object to'' an sequence, for example an association.
Adds the ''object to'' a sequence, for example, an association.
{| class="wikitable"
{| class="wikitable"
!Expression
!Expression
Line 8: Line 9:
|The object has been added to the existing association
|The object has been added to the existing association
|}
|}
Note! Add '''changes''' the sequence or association. If you want to append (add) an object to an sequence and return the result ('''without changing''' the underlying data), use [[OCLOperators append|->append]]
Note! Add '''changes''' the sequence or association. If you want to append (add) an object to a sequence and return the result ('''without changing''' the underlying data), use [[OCLOperators append|->append.]]
[[Category:OCLOperators]]
{{Edited|July|12|2024}}

Latest revision as of 07:49, 17 June 2024

.add ( object : T )

Adds the object to a sequence, for example, an association.

Expression Result
self.<association of type T>.add(<object : T>) The object has been added to the existing association

Note! Add changes the sequence or association. If you want to append (add) an object to a sequence and return the result (without changing the underlying data), use ->append.

This page was edited 95 days ago on 06/17/2024. What links here