Package org.jcsp.lang

Class ChannelInt


  • public class ChannelInt
    extends java.lang.Object
    Deprecated.
    To create integer channels, use the methods in the Channel class.
    This class provides static factory methods for constructing various different types of int channel objects. There are also methods for constructing arrays of identical int channels. The current implementation constructs "safe" channels which have separate delegate objects for their read and write ends. This stops a ChannelInputInt from being cast into a ChannelOutputInt object. The SafeChannelIntFactory class is used to construct the channels. Non-safe channels can be constructed by using an instance of the StandardChannelIntFactory class. The channels produced by this factory have read and write ends implemented by the same object. This is is more efficient (there are two extra objects and delegate method calls) but could lead to errors if users make incorrect casts.
    Author:
    Quickstone Technologies Limited
    • Method Detail

      • getInputArray

        public static SharedChannelInputInt[] getInputArray​(Any2AnyChannelInt[] c)
        Deprecated.
        Constructs and returns an array of input channel ends, each of which can be shared by multiple concurrent readers. The returned array, r, is constructed such that r[i] = c[i].in () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain input ends from.
        Returns:
        the array of channel input ends.
      • getInputArray

        public static AltingChannelInputInt[] getInputArray​(Any2OneChannelInt[] c)
        Deprecated.
        Constructs and returns an array of input channel ends, each of which can be used as guards in an Alternative. The returned array, r, is constructed such that r[i] = c[i].in () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain input ends from.
        Returns:
        the array of channel input ends.
      • getInputArray

        public static SharedChannelInputInt[] getInputArray​(One2AnyChannelInt[] c)
        Deprecated.
        Constructs and returns an array of input channel ends, each of which can be shared by multiple concurrent readers. The returned array, r, is constructed such that r[i] = c[i].in () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain input ends from.
        Returns:
        the array of channel input ends.
      • getInputArray

        public static AltingChannelInputInt[] getInputArray​(One2OneChannelInt[] c)
        Deprecated.
        Constructs and returns an array of input channel ends, each of which can be used as guards in an Alternative. The returned array, r, is constructed such that r[i] = c[i].in () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain input ends from.
        Returns:
        the array of channel input ends.
      • getOutputArray

        public static SharedChannelOutputInt[] getOutputArray​(Any2AnyChannelInt[] c)
        Deprecated.
        Constructs and returns an array of output channel ends, each of which can be shared by multiple concurrent writers. The returned array, r, is constructed such that r[i] = c[i].out () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain output ends from.
        Returns:
        the array of output input ends.
      • getOutputArray

        public static SharedChannelOutputInt[] getOutputArray​(Any2OneChannelInt[] c)
        Deprecated.
        Constructs and returns an array of output channel ends, each of which can be shared by multiple concurrent writers. The returned array, r, is constructed such that r[i] = c[i].out () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain output ends from.
        Returns:
        the array of output input ends.
      • getOutputArray

        public static ChannelOutputInt[] getOutputArray​(One2AnyChannelInt[] c)
        Deprecated.
        Constructs and returns an array of output channel ends, each of which can only be used by a single writer. The returned array, r, is constructed such that r[i] = c[i].out () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain output ends from.
        Returns:
        the array of output input ends.
      • getOutputArray

        public static ChannelOutputInt[] getOutputArray​(One2OneChannelInt[] c)
        Deprecated.
        Constructs and returns an array of output channel ends, each of which can only be used by a single writer. The returned array, r, is constructed such that r[i] = c[i].out () for 0 <= i < c.length.
        Parameters:
        c - the array of channel to obtain output ends from.
        Returns:
        the array of output input ends.