Ejemplo n.º 1
0
 /**
  * Propagate existence of this object to the specified object. This overrides the base class to
  * set the container.
  *
  * @param container Object to contain the new object.
  * @exception IllegalActionException If the object cannot be cloned.
  * @return A new object of the same class and name as this one.
  */
 protected NamedObj _propagateExistence(NamedObj container) throws IllegalActionException {
   try {
     ComponentRelation newObject = (ComponentRelation) super._propagateExistence(container);
     newObject.setContainer((CompositeEntity) container);
     return newObject;
   } catch (NameDuplicationException e) {
     throw new InternalErrorException(e);
   }
 }
Ejemplo n.º 2
0
 /**
  * Construct a relation with the given name contained by the specified entity. The container
  * argument must not be null, or a NullPointerException will be thrown. This relation will use the
  * workspace of the container for synchronization and version counts. If the name argument is
  * null, then the name is set to the empty string. This constructor write-synchronizes on the
  * workspace.
  *
  * @param container The container.
  * @param name The name of the relation.
  * @exception IllegalActionException If the container is incompatible with this relation.
  * @exception NameDuplicationException If the name coincides with a relation already in the
  *     container.
  */
 public ComponentRelation(CompositeEntity container, String name)
     throws IllegalActionException, NameDuplicationException {
   super(container.workspace(), name);
   setContainer(container);
 }