
BooleanMultiplexor |
ptolemy.actor.lib.BooleanMultiplexor |
A type polymorphic multiplexor with boolean valued select.
If any input port has no token, the prefire method returns false and
the fire method is not called. Tokens are only consumed in the fire method,
where exactly one token is consumed from each input port, and one
of the tokens from either trueInput or falseInput is sent
to the output. The token sent to the output
is determined by the select input, which must be a boolean value.
Because tokens are immutable, the same Token
is sent to the output, rather than a copy.
The trueInput and falseInput port may receive Tokens of
any type.
This actor is different from the BooleanSelect actor, which consumes
one token from the control input and another token from either the
trueInput or the falseInput in each firing.
Author(s): Steve Neuendorffer
Version:$Id: BooleanMultiplexor.java,v 1.26 2005/10/28 19:20:13 cxh Exp $
Pt.Proposed Rating:Green (neuendor)
Pt.Accepted Rating:Yellow (neuendor)
trueInput
Input for tokens on the true path. The type can be anything.
falseInput
Input for tokens on the false path. The type can be anything.
select
Input that selects one of the other input ports. The type is
BooleanToken.
output
The output port. The type is at least the type of
trueInput and falseInput