All Packages Class Hierarchy This Package Previous Next Index
Class jcsp.lang.ints.Many2ManyChannelInt
java.lang.Object
|
+----jcsp.lang.ints.Many2ManyChannelInt
- public class Many2ManyChannelInt
- extends Object
- implements ChannelInt
Description
The Many2ManyChannelInt is an implementation of an ChannelInt which
is safe to use with many Reading Process and many Writing Process.
This implementation of the ChannelInt uses Objects which conform to the
ChannelDataStoreInt interface to store the data sent across the ChannelInt. This
enables the storage policy to be defined when the channel is constructed.
Also system constructors can define their own storage types.
This class also defines two static methods that can be used to create
an array of Many2ManyChannelInt. The first of the two can be used to create
an array with the default ChannelDataStoreInt and the second allows the
type of the ChannelDataStoreInt to be specified.
- Author:
- P.D.Austin
-
data
- The ChannelDataStoreInt used to store the data for the ChannelInt
-
readMonitor
- The monitor reads must synchronize on
-
writeMonitor
- The monitor writes must synchronize on
-
Many2ManyChannelInt()
- Constructs a new Many2ManyChannelInt with a ZeroBufferInt ChannelDataStoreInt.
-
Many2ManyChannelInt(ChannelDataStoreInt)
- Constructs a new Many2ManyChannelInt with the specified ChannelDataStoreInt.
-
create(int)
- Creates an array of Many2ManyChannelInts.
-
create(int, ChannelDataStoreInt)
- Creates an array of Many2ManyChannelInts using the specified ChannelDataStoreInt.
-
read()
- Reads an int from the ChannelInt.
-
write(int)
- Writes an int to the ChannelInt.
data
protected ChannelDataStoreInt data
- The ChannelDataStoreInt used to store the data for the ChannelInt
readMonitor
protected Object readMonitor
- The monitor reads must synchronize on
writeMonitor
protected Object writeMonitor
- The monitor writes must synchronize on
Many2ManyChannelInt
public Many2ManyChannelInt()
- Constructs a new Many2ManyChannelInt with a ZeroBufferInt ChannelDataStoreInt.
Many2ManyChannelInt
public Many2ManyChannelInt(ChannelDataStoreInt o)
- Constructs a new Many2ManyChannelInt with the specified ChannelDataStoreInt.
- Parameters:
- data - The ChannelDataStoreInt used to store the data for the ChannelInt
read
public int read()
- Reads an int from the ChannelInt. This method also ensures only one
of the readers can actually be reading at any time. All other readers
are blocked until it completes the read.
- Returns:
- The int returned from the ChannelInt.
write
public void write(int value)
- Writes an int to the ChannelInt. This method also ensures only one
of the writers can actually be writing at any time. All other writers
are blocked until it completes the write.
- Parameters:
- value - The object to write to the ChannelInt.
create
public static Many2ManyChannelInt[] create(int n)
- Creates an array of Many2ManyChannelInts.
- Parameters:
- n - The number of channels to create in the array
- Returns:
- The array of Many2ManyChannelInt
create
public static Many2ManyChannelInt[] create(int n,
ChannelDataStoreInt store)
- Creates an array of Many2ManyChannelInts using the specified ChannelDataStoreInt.
- Parameters:
- n - The number of channels to create in the array
- Returns:
- The array of Many2ManyChannelInt
All Packages Class Hierarchy This Package Previous Next Index