Class BaseMultipleMethodsActor

    • Field Detail

      • _defaultFireMethodName

        protected java.lang.String _defaultFireMethodName
        The number for the default fire method.
      • _methodList

        protected java.util.List<java.lang.String> _methodList
        The list of method names for the actor.
      • _fireMethodName

        protected java.lang.String _fireMethodName
        The string name of the fire method currently being used.
      • _fireMethodNameToInputPortList

        protected java.util.Hashtable<java.lang.String,​java.util.List<IOPort>> _fireMethodNameToInputPortList
        The hashtable that maps fire method names to their list of input ports.
    • Constructor Detail

    • Method Detail

      • getDefaultFireMethodName

        public java.lang.String getDefaultFireMethodName()
        Return the name of the default fire method for this actor.
        Specified by:
        getDefaultFireMethodName in interface MultipleFireMethodsInterface
        Returns:
        The string name of the default fire method for the actor. If the actor does not have multiple fire methods, return null.
      • getFireMethodNames

        public java.util.List<java.lang.String> getFireMethodNames()
        Return the list of strings that represent the names of all the fire methods the actor has.
        Specified by:
        getFireMethodNames in interface MultipleFireMethodsInterface
        Returns:
        The list of fire method names strings.
      • getMethodInputPortList

        public java.util.List<IOPort> getMethodInputPortList​(java.lang.String methodName)
        Return the list of input ports associated with the given method name. If the method has no input ports, return an empty list. If the actor does not have multiple methods, return null.
        Specified by:
        getMethodInputPortList in interface MultipleFireMethodsInterface
        Parameters:
        methodName - The specified method name.
        Returns:
        The list of input ports associated with the method name.
      • getMethodOutputPort

        public IOPort getMethodOutputPort​(java.lang.String methodName)
        Return the output port associated with the given method name, if there is one. If the method does not have any outputs, or the actor does not have multiple fire methods, return null
        Specified by:
        getMethodOutputPort in interface MultipleFireMethodsInterface
        Parameters:
        methodName - The specified name of the method.
        Returns:
        The output port associated with this method, or null is there is none.
      • numFireMethods

        public int numFireMethods()
        Return the number of fire methods the actor has.
        Specified by:
        numFireMethods in interface MultipleFireMethodsInterface
        Returns:
        the number of fire methods the actor has, which should be at least one.
      • _addFireMethod

        protected void _addFireMethod​(java.lang.String methodName,
                                      IOPort outputPort,
                                      java.util.List<IOPort> inputPorts)
                               throws IllegalActionException,
                                      NameDuplicationException
        Add a fire method for this actor with the specified name. A fire method can optionally be associated with one output port and a list of input ports. No two methods can be associated with the same input port or output port. And no two methods can have the same name.
        Parameters:
        methodName - The name of the fire method to be added.
        outputPort - The output port associated with this method, or null if there is none.
        inputPorts - The list of input ports associated with this method, or null if there are none.
        Throws:
        IllegalActionException - If a the method specifies an output port or input ports already associated with another fire method.
        NameDuplicationException - If there is already another method with the same name specified for this actor.