OCLOperators insertAt
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Insert an object in a specific place in a collection or association. | Insert an object in a specific place in a collection or association. <collection>.insertAt(<position>, <nowiki><object>)</nowiki> Used when you don't want a new object at the end using [[OCLOperators add|add]]. | ||
<collection>.insertAt(<position>, <nowiki><object>)</nowiki> | |||
Used when you don't want a new object at the end using [[OCLOperators add|add]]. | |||
For associations, it | For associations, it only makes sense to use insertAt on ordered associations. | ||
* Note that the position | * Note that the position is 1-based, not 0. | ||
See also: [[Association]] | See also: [[Association]] | ||
[[Category:OCLOperators]] | [[Category:OCLOperators]] |
Revision as of 07:15, 3 March 2023
This page was created by Lars.olofsson on 2022-07-30. Last edited by Stephanie on 2025-02-10.
Insert an object in a specific place in a collection or association. <collection>.insertAt(<position>, <object>) Used when you don't want a new object at the end using add.
For associations, it only makes sense to use insertAt on ordered associations.
- Note that the position is 1-based, not 0.
See also: Association