|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcsp.plugNplay.And
public final class And
Bitwise ands two Integer streams to one stream.
Input Channels | ||
---|---|---|
in0, in1 | 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 AndExample { 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 Generate (b.out (), Integer.MAX_VALUE - 1), new And (a.in (), b.in (), c.out ()), new Printer (c.in (), "--> ", "\n") } ).run (); } }
Constructor Summary | |
---|---|
And(ChannelInput in0,
ChannelInput in1,
ChannelOutput out)
Construct a new And process with the input Channels in0 and in1 and the output Channel out. |
Method Summary | |
---|---|
void |
run()
The main body of this process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public And(ChannelInput in0, ChannelInput in1, ChannelOutput out)
in0
- the first input Channelin1
- the second input Channelout
- the output ChannelMethod Detail |
---|
public void run()
run
in interface CSProcess
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |