|
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.ProcessWrite
public class ProcessWrite
Writes one Object to its output channel.
ProcessWrite declaration, construction and use should normally be localised within a single method -- so we feel no embarassment about its public field. Its only (envisaged) purpose is as described in the example below.
Output Channels | ||
---|---|---|
out | java.lang.Object | The out Channel can accept data of any Class. |
Parallel
object in which to run them:
ChannelOutput out0, out1; . . . ProcessWrite write0 = new ProcessWrite (out0); ProcessWrite write1 = new ProcessWrite (out1); CSProcess parWrite01 = new Parallel (new CSProcess[] {out0, out1});The above is best done once, before any looping over the parallel write commences. A parallel write can now be performed at any time (and any number of times) by executing:
write0.value = ...; // whatever we want sent down out0 write1.value = ...; // whatever we want sent down out1 parWrite01.run ();The last line above terminates when, and only when, both writes have completed -- the events may occur in any order.
Parallel
,
ProcessRead
,
ProcessReadInt
,
ProcessWriteInt
Field Summary | |
---|---|
Object |
value
The Object to be written to the channel |
Constructor Summary | |
---|---|
ProcessWrite(ChannelOutput out)
Construct a new ProcessWrite. |
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 |
Field Detail |
---|
public Object value
Constructor Detail |
---|
public ProcessWrite(ChannelOutput out)
out
- the channel to which to writeMethod 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 |