public final class Nand
Bitwise nands 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 Nand 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.org.jcsp.lang.*; import org.jcsp.util.*; public class NandExample { 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 Nand (a.in (), b.in (), c.out ()), new Successor (c.in (), d.out ()), new Printer (d.in ()), new CSProcess () { public void run () { Integer nandVal = new Integer (Integer.MAX_VALUE); while (true) { b.out ().write (nandVal); } } } }).run (); } }
Constructor and description |
---|
Nand
(ChannelInput in1, ChannelInput in2, ChannelOutput out) Construct a new Nand process with the input Channels in1 and in2 and the output Channel out. |
Construct a new Nand process with the input Channels in1 and in2 and the output Channel out. The ordering of the Channels in1 and in2 make no difference to the functionality of this process.
in1
- the first input Channelin2
- the second input Channelout
- the output ChannelJCSP for Java 1.8 generated 14-10-2016 by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk