public final class SignInt
Converts each input int to a String, prefixing it with a user-defined sign.
Input Channels | ||
---|---|---|
in | int | Almost all channels in this package carry integers. |
Output Channels | ||
out | java.lang.String | The output will be of type String. |
import org.jcsp.lang.*; import org.jcsp.plugNplay.ints.*; import org.jcsp.plugNplay.*; public final class SignIntExample { public static void main (String[] argv) { final One2OneChannelInt[] a = ChannelInt.createOne2One (3); final One2OneChannel[] b = ChannelInt.createOne2One (3); final One2OneChannel c = ChannelInt.createOne2One (); new Parallel ( new CSProcess[] { new NumbersInt (a[0].out ()), new FibonacciInt (a[1].out ()), new SquaresInt (a[2].out ()), new SignInt ("Numbers ", a[0].in (), b[0].out ()), new SignInt (" Fibonacci ", a[1].in (), b[1].out ()), new SignInt (" Squares ", a[2].in (), b[2].out ()), new Plex (ChannelInt.getInputArray (b), c.out ()), new Printer (c.in (), "", "\n") } ).run (); } }
Constructor and description |
---|
SignInt
(String sign, ChannelInputInt in, ChannelOutput out) Construct a new Sign process with the input Channel in and the output Channel out. |
Construct a new Sign process with the input Channel in and the output Channel out.
sign
- the user-defined signature to attach to each item.in
- the input Channel.out
- the output Channel.JCSP for Java 1.8 generated 14-10-2016 by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk