The specified index can be any non-negative integer. Any links with indices larger than or equal to the one specified here will henceforth have indices that are larger by one. If the index is larger than the number of existing links (as returned by numLinks()), then empty links are inserted (these will be null elements in the list returned by linkedRelationsList() or in the enumeration returned by linkedRelations()). If the specified relation is null, then an empty outside link is inserted at the specified index.
Note that a port may be linked to the same relation more than once, in which case the link will be reported more than once by the linkedRelations() method.
In derived classes, the relation may be required to be an instance of a particular subclass of Relation (this is checked by the _checkLink() protected method).
This method is write-synchronized on the workspace and increments its version number. @param index The index at which to insert the link. @param relation The relation to link to this port. @exception IllegalActionException If the link would cross levels ofthe hierarchy, or the relation is incompatible, or the port has no container, or the port is not in the same workspace as the relation.
|
|
|
|
|
|