public final class Or extends java.lang.Object implements CSProcess
in0 ____ -->--| | out in1 | Or |-->-- -->--|____|
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 OrExample { public static void main (String[] argv) { final One2OneChannel a = Channel.one2one (); final One2OneChannel b = Channel.one2one (); final One2OneChannel c = Channel.one2one (); final One2OneChannel d = Channel.one2one (); new Parallel ( new CSProcess[] { new Numbers (a.out ()), new Generate (b.out (), 1), new Or (a.in (), b.in (), c.out ()), new Successor (c.in (), d.out ()), new Printer (d.in (), "--> ", "\n") } ).run (); } }
Modifier and Type | Field and Description |
---|---|
private ChannelInput |
in1
The first input Channel
|
private ChannelInput |
in2
The second input Channel
|
private ChannelOutput |
out
The output Channel
|
Constructor and Description |
---|
Or(ChannelInput in1,
ChannelInput in2,
ChannelOutput out)
Construct a new Or process with the input Channels in1 and in2 and the
output Channel out.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
The main body of this process.
|
private ChannelInput in1
private ChannelInput in2
private ChannelOutput out
public Or(ChannelInput in1, ChannelInput in2, ChannelOutput out)
in1
- the first input Channelin2
- the second input Channelout
- the output Channel