|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jcsp.plugNplay.ints.Merge2Int
public final class Merge2Int
Merges two strictly increasing int input streams into one strictly increasing output stream.

| Input Channels | ||
|---|---|---|
| in0, in1 | int | All channels in this package carry integers. |
| Output Channels | ||
| out | int | All channels in this package carry integers. |
import org.jcsp.lang.*;
import org.jcsp.util.ints.*;
public final class Merge2IntExample {
public static void main (String[] argv) {
final One2OneChannelInt[] a = ChannelInt.createOne2One (4);
final One2OneChannelInt[] b = ChannelInt.createOne2One (3,
new InfiniteBufferInt ());
final One2OneChannelInt c = ChannelInt.createOne2One ();
final One2OneChannelInt d = ChannelInt.createOne2One ();
final One2OneChannelInt e = ChannelInt.createOne2One ();
new Parallel (
new CSProcess[] {
new MultInt (2, a[0].in (), b[0].out ()),
new MultInt (3, a[1].in (), b[1].out ()),
new MultInt (5, a[2].in (), b[2].out ()),
new Merge2Int (b[0].in (), b[1].in (), c.out ()),
new Merge2Int (c.in (), b[2].in (), d.out ()),
new PrefixInt (1, d.in (), e.out ()),
new DeltaInt (e.in (), ChannelInt.getOutputArray (a)),
new PrinterInt (a[3].in (), "--> ", "\n")
}
).run ();
}
}
MergeInt| Constructor Summary | |
|---|---|
Merge2Int(ChannelInputInt in0,
ChannelInputInt in1,
ChannelOutputInt out)
Construct a new Merge2Int process with the input channels in0 and in1 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 Merge2Int(ChannelInputInt in0,
ChannelInputInt in1,
ChannelOutputInt out)
in0 - an input channelin1 - an input channelout - the output channel| Method Detail |
|---|
public void run()
run in interface CSProcess
|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||