|
CSP for Java (JCSP) 1.1-rc2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.plugNplay.Nor
public final class Nor
Bitwise nors two Integer streams to one stream.
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.util.*; public class NorExample { public static void main (String[] argv) { One2OneChannel a = Channel.createOne2One (); One2OneChannel b = Channel.createOne2One (); One2OneChannel c = Channel.createOne2One (); One2OneChannel d = Channel.createOne2One (); new Parallel ( new CSProcess[] { new Numbers (a.out ()), new Nor (a.in (), b.in (), c.out ()), new Successor (c.in (), d.out ()), new Printer (d.in ()), new CSProcess () { public void run () { Integer norVal = new Integer (0); while (true) { b.out ().write (norVal); } } } } ).run (); } }
Constructor Summary | |
---|---|
Nor(ChannelInput in1,
ChannelInput in2,
ChannelOutput out)
Construct a new Nor process with the input Channels in1 and in2 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 Nor(ChannelInput in1, ChannelInput in2, ChannelOutput out)
in1
- The first input Channelin2
- The second input Channelout
- The output ChannelMethod Detail |
---|
public void run()
run
in interface CSProcess
|
CSP for Java (JCSP) 1.1-rc2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |