Class AddSubtractAll

    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        If there is at least one token on the input ports, add tokens from the plus port, subtract tokens from the minus port, and send the result to the output port. All tokens are read from each channel. If none of the input channels has a token, do nothing. If none of the plus channels have tokens, then the tokens on the minus channels are subtracted from a zero token of the same type as the first token encountered on the minus channels.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AddSubtract
        Throws:
        IllegalActionException - Thrown if there is no director, or if addition and subtraction are not supported by the available tokens.