Class Equals

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Equals
    extends Transformer
    A logical equals operator. This operator has one input multiport and one output port that is not a multiport. It will consume at most one token from each input channel, and compare the tokens using the isEqualTo() method of the Token class. If all observed input tokens are equal, then the output will be a true-valued boolean token. If there is not at least one token on the input channels, then no output is produced. The type of the input port is undeclared and will be resolved by the type resolution mechanism. Note that all input channels must resolve to the same type. The type of the output port is boolean.
    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    John Li and Edward A. Lee
    See Also:
    Token.isEqualTo(Token)
    Pt.AcceptedRating:
    Green (johnli)
    Pt.ProposedRating:
    Green (eal)
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Consume at most one token from each input channel, and output the result of comparing these tokens using the isEqualTo() method of the Token class. If the input has width 1, then the output is always true. If the input has width 0, or there are no no input tokens available, then no output is produced.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - If there is no director.