Package org.jcsp.plugNplay
Class Demultiplex
- java.lang.Object
-
- org.jcsp.plugNplay.Demultiplex
-
- All Implemented Interfaces:
CSProcess
public final class Demultiplex extends java.lang.Object implements CSProcess
This demultiplexes data from its input channel to its output channel array.Process Diagram

Description
Demultiplex is a process to convert the single stream of (Integer, Object) messages sent from aMultiplexprocess on the other end of its in channel back into separate streams (its out channels). It assumes thatMultiplexoperates on the same size array of channels as its out array.The protocol on the incoming multiplexed stream consists of an Integer, that represents the channel identity of the multiplexed data, followed by the multiplexed data.
Channel Protocols
Input Channels in java.lang.Integer, java.lang.Object A channel index followed by the multiplexed data. Output Channels out[] java.lang.Object All channels in this package carry integers. - See Also:
Multiplex,Paraplex,Deparaplex
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelInputinThe input Channelprivate ChannelOutput[]outThe output Channels
-
Constructor Summary
Constructors Constructor Description Demultiplex(ChannelInput in, ChannelOutput[] out)Construct a new Demultiplex process with the input Channel in and the output Channels out.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()The main body of this process.
-
-
-
Field Detail
-
in
private final ChannelInput in
The input Channel
-
out
private final ChannelOutput[] out
The output Channels
-
-
Constructor Detail
-
Demultiplex
public Demultiplex(ChannelInput in, ChannelOutput[] out)
Construct a new Demultiplex process with the input Channel in and the output Channels out. The ordering of the Channels in the out array make no difference to the functionality of this process.- Parameters:
in- the input channelout- the output channels
-
-