Class MetroIIMirrorComposite

    • Constructor Detail

      • MetroIIMirrorComposite

        public MetroIIMirrorComposite​(CompositeEntity container,
                                      java.lang.String name)
                               throws IllegalActionException,
                                      NameDuplicationException
        Create an actor with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor 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. Increment the version of the workspace.
        Parameters:
        container - The container actor.
        name - The name of this actor.
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.
      • MetroIIMirrorComposite

        public MetroIIMirrorComposite​(Workspace workspace)
        Construct a MirrorComposite in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. You should set the local director or executive director before attempting to send data to the actor or to execute it. Add the actor to the workspace directory. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the actor.
      • MetroIIMirrorComposite

        public MetroIIMirrorComposite​(CompositeEntity container,
                                      java.lang.String name,
                                      boolean mirrorParameterPorts)
                               throws IllegalActionException,
                                      NameDuplicationException
        Create an actor with a name and a container that optionally mirrors the ports that are instances of ParameterPort. The container argument must not be null, or a NullPointerException will be thrown. This actor 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. Increment the version of the workspace.
        Parameters:
        container - The container actor.
        name - The name of this actor.
        mirrorParameterPorts - If false, then ports that are instances of ParameterPort are not mirrored.
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the object into the specified workspace. This overrides the base class to set up the associations in the mirror ports and to set a flag indicating that cloning is complete.
        Overrides:
        clone in class CompositeActor
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new NamedObj.
        Throws:
        java.lang.CloneNotSupportedException - If any of the attributes cannot be cloned.
        See Also:
        CompositeEntity.exportMoML(Writer, int, String)
      • newParameterPort

        public Port newParameterPort​(java.lang.String name)
                              throws NameDuplicationException
        Create a new ParameterMirrorPort.
        Parameters:
        name - The name of the port to create.
        Returns:
        A new instance of PtidesMirrorPort, an inner class.
        Throws:
        NameDuplicationException - If the container already has a port with this name.
      • _addEntity

        protected void _addEntity​(ComponentEntity entity)
                           throws IllegalActionException,
                                  NameDuplicationException
        Override the base class to queue a change request to remove any previously contained entity and its mirrored ports, and to mirror the ports of the added entity.
        Overrides:
        _addEntity in class TypedCompositeActor
        Parameters:
        entity - Entity to contain.
        Throws:
        IllegalActionException - If the entity has no name, or the action would result in a recursive containment structure, or the argument does not implement the TypedActor interface.
        NameDuplicationException - If the name collides with a name already on the actor contents list, or if the added element is a class definition.
      • _exportMoMLContents

        protected void _exportMoMLContents​(java.io.Writer output,
                                           int depth)
                                    throws java.io.IOException
        Override the base class to describe contained entities, attributes, and ports, but not inside links or relations. The rest of the contents are generated automatically when a contained entity is inserted.
        Overrides:
        _exportMoMLContents in class CompositeEntity
        Parameters:
        output - The output to write to.
        depth - The depth in the hierarchy, to determine indenting.
        Throws:
        java.io.IOException - If an I/O error occurs.
        See Also:
        NamedObj.exportMoML(Writer, int)
      • _removeEntity

        protected void _removeEntity​(ComponentEntity entity)
        Override the base class to remove the ports and inside relations of this actor. This method assumes the caller has write access on the workspace.
        Overrides:
        _removeEntity in class CompositeEntity
        Parameters:
        entity - The entity being removed from this entity.
      • _removePort

        protected void _removePort​(Port port)
        Override the base class to remove the associated port on the inside entity and the link to it, if there is one. This method assumes the caller has write access on the workspace.
        Overrides:
        _removePort in class Entity
        Parameters:
        port - The port being removed from this entity.