Class ParameterMirrorPort

    • Constructor Detail

      • ParameterMirrorPort

        public ParameterMirrorPort​(ComponentEntity container,
                                   java.lang.String name)
                            throws IllegalActionException,
                                   NameDuplicationException
        Construct a new input port in the specified container with the specified name. The specified container must implement the Actor interface, or an exception will be thrown.
        Parameters:
        container - The container.
        name - The name of the port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the Actor interface.
        NameDuplicationException - If the name coincides with a port 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 unset the associated port. Users of this class are responsible for resetting it in their clone methods.
        Overrides:
        clone in class ParameterPort
        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:
        NamedObj.exportMoML(java.io.Writer, int, String)
      • setAssociatedPort

        public void setAssociatedPort​(ParameterMirrorPort port)
        Specify an associated port. Once this is specified, then any changes made to this port (its name, whether it is an input or output, and whether it is a multiport) are mirrored in the associated port, and any changes made in the associated port are mirrored here.
        Parameters:
        port - The associated port.
        See Also:
        getAssociatedPort()
      • setContainer

        public void setContainer​(Entity container)
                          throws IllegalActionException,
                                 NameDuplicationException
        Override the base class so that if the container is being set to null, then the associated port is also deleted (via a change request). Note that if the container of this port is changed to something other than null, there is no reasonable basis for changing the container of the associated port, so it is left unchanged.
        Overrides:
        setContainer in class ParameterPort
        Parameters:
        container - The proposed container.
        Throws:
        IllegalActionException - If the proposed container is not a ComponentEntity, doesn't implement Actor, or has no name, or the port and container are not in the same workspace. Or it's not null
        NameDuplicationException - If the container already has a port with the name of this port.
        See Also:
        PortParameter
      • setInput

        public void setInput​(boolean isInput)
                      throws IllegalActionException
        Override the base class to also set the associated port, if there is one.
        Overrides:
        setInput in class IOPort
        Parameters:
        isInput - True to make this an input port.
        Throws:
        IllegalActionException - If changing the port status is not permitted.