Class MethodCallPort

    • Constructor Detail

      • MethodCallPort

        public MethodCallPort()
        Construct a port in the default workspace with an empty string as its name. Increment the version number of the workspace. The object is added to the workspace directory.
      • MethodCallPort

        public MethodCallPort​(Workspace workspace)
        Construct a port in the specified workspace with 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. The object is added to the workspace directory. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the port.
      • MethodCallPort

        public MethodCallPort​(ComponentEntity container,
                              java.lang.String name)
                       throws IllegalActionException,
                              NameDuplicationException
        Construct a port with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This port 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 entity.
        name - The name of the port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container.
        NameDuplicationException - If the name coincides with a port already in the container.
      • MethodCallPort

        public MethodCallPort​(ComponentEntity container,
                              java.lang.String name,
                              boolean isProvidedPort)
                       throws IllegalActionException,
                              NameDuplicationException
        Construct an IOPort with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments. The specified container must implement the Actor interface or an exception will be thrown.
        Parameters:
        container - The container actor.
        name - The name of the port.
        isProvidedPort - True if this port provides the method.
        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. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is a new port with no connections and no container.
        Overrides:
        clone in class ComponentPort
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        A new ComponentPort.
        Throws:
        java.lang.CloneNotSupportedException - If one or more of the attributes cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • call

        public TupleToken call​(TupleToken arguments)
        Call the method associated with this port with the specified arguments.

        If this port is a provider, as indicated by @link{#isProvider()}, then this method returns TupleToken.VOID, an empty tuple token. Subclasses should override this method to perform whatever functionality is associated with this method.

        If this port is not a provider of this method, then this method delegates the call to all ports to which this port is deeply connected that are providers. The order in which those calls are performed is determined by the order in which connections are made. The returned token is a concatenation of the returned values of all the called methods. If there is nothing connected, then this method will return TupleToken.VOID.

        Parameters:
        arguments - The arguments to the method.
        See Also:
        isProvider(), TupleToken.VOID