OCLOperators insertAt
(Created page with "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 OCLO...")
 
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>, <object>)
<collection>.insertAt(<position>, <nowiki><object>)</nowiki>
Used when you don't want a new object at the end using [[OCLOperators add|add]].  
Used when you don't want a new object at the end using [[OCLOperators add|add]].  


For associations, it's only makes sense to use insertAt on ordered associations.
For associations, it's only makes sense to use insertAt on ordered associations.
* Note that the position in 1-based, not 0.
* Note that the position in 1-based, not 0.
See also: [[Association]]

Revision as of 10:49, 30 July 2022

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's only makes sense to use insertAt on ordered associations.

  • Note that the position in 1-based, not 0.

See also: Association

This page was edited 84 days ago on 02/10/2024. What links here