|
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.Sign
public final class Sign
Converts each input Object to a String, prefixing it with a user-defined sign.
Input Channels | ||
---|---|---|
in | java.lang.Object | The Channel accepts any class of data. |
Output Channels | ||
out | java.lang.String | The output will always be of type String. |
import org.jcsp.lang.*; import org.jcsp.plugNplay.*; public class SignExample { public static void main (String[] argv) { final One2OneChannel[] a = Channel.one2oneArray (3); final One2OneChannel[] b = Channel.one2oneArray (3); final One2OneChannel c = Channel.one2one (); new Parallel ( new CSProcess[] { new Numbers (a[0].out ()), new Fibonacci (a[1].out ()), new Squares (a[2].out ()), new Sign ("Numbers ", a[0].in (), b[0].out ()), new Sign (" Fibonacci ", a[1].in (), b[1].out ()), new Sign (" Squares ", a[2].in (), b[2].out ()), new Plex (Channel.getInputArray (b), c.out ()), new Printer (c.in (), "", "\n") } ).run (); } }
SignInt
Constructor Summary | |
---|---|
Sign(String sign,
ChannelInput in,
ChannelOutput out)
Construct a new Sign process with the input Channel in 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 Sign(String sign, ChannelInput in, ChannelOutput out)
sign
- the user-defined signature to attach to each item.in
- the input Channel.out
- the output Channel.Method 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 |