public final class Plus extends Object implements CSProcess
in0 ______ -->--| | out in1 | Plus |-->-- -->--|______|
Input Channels | ||
---|---|---|
in1,in2 | java.lang.Number | Both Channels can accept data from any subclass of Number. It is possible to send Floats down one channel and Integers down the other. However all values will be converted to ints. |
Output Channels | ||
out | java.lang.Integer | The output will always be of type Integer. |
import org.jcsp.lang.*; import org.jcsp.plugNplay.*; public class PlusExample { public static void main (String[] argv) { final One2OneChannel a = Channel.one2one (); final One2OneChannel b = Channel.one2one (); final One2OneChannel c = Channel.one2one (); new Parallel ( new CSProcess[] { new Numbers (a.out ()), new Numbers (b.out ()), new Plus (a.in (), b.in (), c.out ()), new Printer (c.in (), "--> ", "\n") } ).run (); } }
Constructor and Description |
---|
Plus(ChannelInput in1,
ChannelInput in2,
ChannelOutput out)
Construct a new Plus process with the input Channels in1 and in2 and the
output Channel out.
|
public Plus(ChannelInput in1, ChannelInput in2, ChannelOutput out)
in1
- The first input Channelin2
- The second input Channelout
- The output ChannelCopyright © 1996–2016. All rights reserved.