public final class Xor extends java.lang.Object implements CSProcess
in0 _____ -->--| | out in1 | Xor |-->-- -->--|_____|
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 XorExample { public static void main (String[] argv) { One2OneChannel a = Channel.one2one (); One2OneChannel b = Channel.one2one (); One2OneChannel c = Channel.one2one (); new Parallel ( new CSProcess[] { new Numbers (a.out ()), new Generate (b.out (), Integer.MAX_VALUE), new Xor (a.in (), b.in (), c.out ()), new Printer (c.in (), "--> ", "\n") } ).run (); } }
Constructor and Description |
---|
Xor(ChannelInput in1,
ChannelInput in2,
ChannelOutput out)
Construct a new Xor 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.
|
public Xor(ChannelInput in1, ChannelInput in2, ChannelOutput out)
in1
- The first input Channelin2
- The second input Channelout
- The output ChannelSubmit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.