OCLOperators add
(Automatically adding template at the end of the page.)
No edit summary
 
(3 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'' a sequence, for example, an association.
Adds the ''object to'' a sequence, for example, an association.
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 a 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 [[Documentation:OCLOperators append|->append.]]
[[Category:OCLOperators]]
[[Category:OCLOperators]]
{{Edited|July|12|2024}}
{{Edited|July|12|2025}}

Latest revision as of 05:29, 10 February 2025

This page was created by Lars.olofsson@mdriven.net on 2018-10-28. Last edited by Stephanie@mdriven.net on 2025-02-10.

.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.