CSP for Java
(JCSP) 1.1-rc4

Interface ChannelOutputInt

All Superinterfaces:
All Known Subinterfaces:
All Known Implementing Classes:
AltingChannelOutputInt, BlackHoleChannelInt

public interface ChannelOutputInt
extends Poisonable

This defines the interface for writing to integer channels.

A writing-end, conforming to this interface, is obtained from a channel by invoking its out() method.


ChannelOutputInt defines the interface for writing to integer channels. The interface contains only one method - write(int o). This method will block the calling process until the int has been accepted by the channel. In the (default) case of a zero-buffered synchronising CSP channel, this happens only when a process at the other end of the channel invokes (or has already invoked) a read().

ChannelOutputInt variables are used to hold integer channels that are going to be used only for output by the declaring process. This is a security matter -- by declaring a ChannelOutputInt interface, any attempt to input from the channel will generate a compile-time error. For example, the following code fragment will not compile:

 int doRead (ChannelOutputInt c) {
   return c.read ();   // illegal
When configuring a CSProcess with output integer channels, they should be declared as ChannelOutputInt variables. The actual channel passed, of course, may belong to any channel class that implements ChannelOutputInt.


 void doWrite (ChannelOutputInt c, int i) {
   c.write (i);

P.D. Austin
See Also:
SharedChannelOutputInt, ChannelInputInt

Method Summary
 void write(int i)
          Write an int to the channel.
Methods inherited from interface org.jcsp.lang.Poisonable

Method Detail


void write(int i)
Write an int to the channel.

i - the integer to write to the channel

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.