1
//////////////////////////////////////////////////////////////////////
3
// JCSP ("CSP for Java") Libraries //
4
// Copyright (C) 1996-2008 Peter Welch and Paul Austin. //
5
// 2001-2004 Quickstone Technologies Limited. //
7
// This library is free software; you can redistribute it and/or //
8
// modify it under the terms of the GNU Lesser General Public //
9
// License as published by the Free Software Foundation; either //
10
// version 2.1 of the License, or (at your option) any later //
13
// This library is distributed in the hope that it will be //
14
// useful, but WITHOUT ANY WARRANTY; without even the implied //
15
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
16
// PURPOSE. See the GNU Lesser General Public License for more //
19
// You should have received a copy of the GNU Lesser General //
20
// Public License along with this library; if not, write to the //
21
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
22
// Boston, MA 02111-1307, USA. //
24
// Author contact: P.H.Welch@kent.ac.uk //
27
//////////////////////////////////////////////////////////////////////
30
import org.jcsp.lang.*;
33
* This process broadcasts integers arriving on its input channel <I>in sequence</I>
34
* to its two output channels.
36
* <H2>Process Diagram</H2>
37
* <!-- INCORRECT DIAGRAM: <p><IMG SRC="doc-files/Delta2Int1.gif"></p> -->
41
* -->--| Delta2Int | out1
42
* |___________|--->---
44
* <H2>Description</H2>
45
* <TT>Delta2Int</TT> is a process that broadcasts (<I>in parallel</I>) on its two output channels
46
* everything that arrives on its input channel.
47
* <H2>Channel Protocols</H2>
50
* <TH COLSPAN="3">Input Channels</TH>
56
* All channels in this package carry integers.
60
* <TH COLSPAN="3">Output Channels</TH>
66
* The output Channels will carry a broadcast of whatever
67
* integers are sent down the in Channel.
72
* @author P.H. Welch and P.D. Austin
75
public final class SeqDelta2Int implements CSProcess
77
/** The input Channel */
78
private final ChannelInputInt in;
80
/** The first output Channel */
81
private final ChannelOutputInt out0;
83
/** The second output Channel */
84
private final ChannelOutputInt out1;
87
* Construct a new Delta2Int process with the input Channel in and the output
88
* Channels out0 and out1. The ordering of the Channels out0 and out1 make
89
* no difference to the functionality of this process.
91
* @param in the input channel
92
* @param out0 an output Channel
93
* @param out1 an output Channel
95
public SeqDelta2Int(final ChannelInputInt in, final ChannelOutputInt out0, final ChannelOutputInt out1)
103
* The main body of this process.
109
int value = in.read();