
BooleanSwitch |
ptolemy.actor.lib.BooleanSwitch |
A type polymorphic switch with boolean valued control. In an
iteration, if an input token is available at the control input,
that token is read, and its value is noted. Its value specifies the
input port that should be read next. If the control input is
true, then if an input token is available on the input port,
then it is is read and sent to the trueOutput. Likewise with a
false input and the falseOutput port. Because tokens are
immutable, the same Token is sent to the output, rather than a copy.
The input port may receive Tokens of any type.
If no token has ever been received on the control port, then
falseOutput is assumed to be the one to receive data.
Author(s): Steve Neuendorffer
Version:$Id: BooleanSwitch.java,v 1.25 2005/10/28 20:14:37 cxh Exp $
Pt.Proposed Rating:Green (neuendor)
Pt.Accepted Rating:Red (neuendor)
control
Input that selects one of the other input ports. The type is
BooleanToken.
input
The input port. The type can be anything.
trueOutput
Output for tokens on the true path. The type is at least the
type of the input.
falseOutput
Output for tokens on the false path. The type is at least the
type of the input.