This class provides static factory methods for constructing various different types of channel objects. There are also methods for constructing arrays of identical channels.
The current implementation constructs "safe" channels which have separate
delegate objects for their read and write ends. This stops a
ChannelInput
from being cast into a ChannelOutput
object. The StandardChannelFactory
class is used to construct the
channels.
Non-safe channels can be constructed by using an instance of the
RiskyChannelFactory
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 less objects and delegate method calls)
but could lead to errors if users make incorrect casts.
Type | Name and description |
---|---|
static Any2AnyChannel |
any2any() |
static Any2AnyChannel |
any2any(ChannelDataStore buffer) |
static Any2AnyChannel |
any2any(int immunity) |
static Any2AnyChannel |
any2any(ChannelDataStore buffer, int immunity) |
static Any2AnyChannel[] |
any2anyArray(int size) |
static Any2AnyChannel[] |
any2anyArray(int size, int immunity) |
static Any2AnyChannel[] |
any2anyArray(int size, ChannelDataStore data) |
static Any2AnyChannel[] |
any2anyArray(int size, ChannelDataStore data, int immunity) |
static Any2AnyChannelInt |
any2anyInt() |
static Any2AnyChannelInt |
any2anyInt(ChannelDataStoreInt buffer) |
static Any2AnyChannelInt |
any2anyInt(int immunity) |
static Any2AnyChannelInt |
any2anyInt(ChannelDataStoreInt buffer, int immunity) |
static Any2AnyChannelInt[] |
any2anyIntArray(int size) |
static Any2AnyChannelInt[] |
any2anyIntArray(int size, int immunity) |
static Any2AnyChannelInt[] |
any2anyIntArray(int size, ChannelDataStoreInt data) |
static Any2AnyChannelInt[] |
any2anyIntArray(int size, ChannelDataStoreInt data, int immunity) |
static Any2OneChannel |
any2one() |
static Any2OneChannel |
any2one(ChannelDataStore buffer) |
static Any2OneChannel |
any2one(int immunity) |
static Any2OneChannel |
any2one(ChannelDataStore buffer, int immunity) |
static Any2OneChannel[] |
any2oneArray(int size) |
static Any2OneChannel[] |
any2oneArray(int size, int immunity) |
static Any2OneChannel[] |
any2oneArray(int size, ChannelDataStore data) |
static Any2OneChannel[] |
any2oneArray(int size, ChannelDataStore data, int immunity) |
static Any2OneChannelInt |
any2oneInt() |
static Any2OneChannelInt |
any2oneInt(ChannelDataStoreInt buffer) |
static Any2OneChannelInt |
any2oneInt(int immunity) |
static Any2OneChannelInt |
any2oneInt(ChannelDataStoreInt buffer, int immunity) |
static Any2OneChannelInt[] |
any2oneIntArray(int size) |
static Any2OneChannelInt[] |
any2oneIntArray(int size, int immunity) |
static Any2OneChannelInt[] |
any2oneIntArray(int size, ChannelDataStoreInt data) |
static Any2OneChannelInt[] |
any2oneIntArray(int size, ChannelDataStoreInt data, int immunity) |
static Any2AnyChannel |
createAny2Any() Constructs and returns an Any2AnyChannel object. |
static Any2AnyChannel[] |
createAny2Any(int n) Constructs and returns an array of Any2AnyChannel
objects. |
static Any2AnyChannel |
createAny2Any(ChannelDataStore buffer) |
static Any2AnyChannel[] |
createAny2Any(ChannelDataStore buffer, int n) |
static Any2OneChannel |
createAny2One() Constructs and returns an Any2OneChannel object. |
static Any2OneChannel[] |
createAny2One(int n) Constructs and returns an array of Any2OneChannel
objects. |
static Any2OneChannel |
createAny2One(ChannelDataStore buffer) |
static Any2OneChannel[] |
createAny2One(ChannelDataStore buffer, int n) |
static One2AnyChannel |
createOne2Any() Constructs and returns a One2AnyChannel object. |
static One2AnyChannel[] |
createOne2Any(int n) Constructs and returns an array of One2AnyChannel
objects. |
static One2AnyChannel |
createOne2Any(ChannelDataStore buffer) |
static One2AnyChannel[] |
createOne2Any(ChannelDataStore buffer, int n) |
static One2OneChannel |
createOne2One() Constructs and returns a One2OneChannel object. |
static One2OneChannel[] |
createOne2One(int n) Constructs and returns an array of One2OneChannel
objects. |
static One2OneChannel |
createOne2One(ChannelDataStore buffer) |
static One2OneChannel[] |
createOne2One(ChannelDataStore buffer, int n) |
static SharedChannelInput[] |
getInputArray(Any2AnyChannel[] c) |
static AltingChannelInput[] |
getInputArray(Any2OneChannel[] c) Constructs and returns an array of input channel ends, each of which can be used as guards in an Alternative . |
static SharedChannelInput[] |
getInputArray(One2AnyChannel[] c) Constructs and returns an array of input channel ends, each of which can be shared by multiple concurrent readers. |
static AltingChannelInput[] |
getInputArray(One2OneChannel[] c) Constructs and returns an array of input channel ends, each of which can be used as guards in an Alternative . |
static SharedChannelOutput[] |
getOutputArray(Any2AnyChannel[] c) Constructs and returns an array of output channel ends, each of which can be shared by multiple concurrent writers. |
static SharedChannelOutput[] |
getOutputArray(Any2OneChannel[] c) Constructs and returns an array of output channel ends, each of which can be shared by multiple concurrent writers. |
static ChannelOutput[] |
getOutputArray(One2AnyChannel[] c) Constructs and returns an array of output channel ends, each of which can only be used by a single writer. |
static ChannelOutput[] |
getOutputArray(One2OneChannel[] c) Constructs and returns an array of output channel ends, each of which can only be used by a single writer. |
static One2AnyChannel |
one2any() |
static One2AnyChannel |
one2any(ChannelDataStore buffer) |
static One2AnyChannel |
one2any(int immunity) |
static One2AnyChannel |
one2any(ChannelDataStore buffer, int immunity) |
static One2AnyChannel[] |
one2anyArray(int size) |
static One2AnyChannel[] |
one2anyArray(int size, int immunity) |
static One2AnyChannel[] |
one2anyArray(int size, ChannelDataStore data) |
static One2AnyChannel[] |
one2anyArray(int size, ChannelDataStore data, int immunity) |
static One2AnyChannelInt |
one2anyInt() |
static One2AnyChannelInt |
one2anyInt(ChannelDataStoreInt buffer) |
static One2AnyChannelInt |
one2anyInt(int immunity) |
static One2AnyChannelInt |
one2anyInt(ChannelDataStoreInt buffer, int immunity) |
static One2AnyChannelInt[] |
one2anyIntArray(int size) |
static One2AnyChannelInt[] |
one2anyIntArray(int size, int immunity) |
static One2AnyChannelInt[] |
one2anyIntArray(int size, ChannelDataStoreInt data) |
static One2AnyChannelInt[] |
one2anyIntArray(int size, ChannelDataStoreInt data, int immunity) |
static One2OneChannel |
one2one() |
static One2OneChannel |
one2one(ChannelDataStore buffer) |
static One2OneChannel |
one2one(int immunity) |
static One2OneChannel |
one2one(ChannelDataStore buffer, int immunity) |
static One2OneChannel[] |
one2oneArray(int size) |
static One2OneChannel[] |
one2oneArray(int size, int immunity) |
static One2OneChannel[] |
one2oneArray(int size, ChannelDataStore data) |
static One2OneChannel[] |
one2oneArray(int size, ChannelDataStore data, int immunity) |
static One2OneChannelInt |
one2oneInt() |
static One2OneChannelInt |
one2oneInt(ChannelDataStoreInt buffer) |
static One2OneChannelInt |
one2oneInt(int immunity) |
static One2OneChannelInt |
one2oneInt(ChannelDataStoreInt buffer, int immunity) |
static One2OneChannelInt[] |
one2oneIntArray(int size) |
static One2OneChannelInt[] |
one2oneIntArray(int size, int immunity) |
static One2OneChannelInt[] |
one2oneIntArray(int size, ChannelDataStoreInt data) |
static One2OneChannelInt[] |
one2oneIntArray(int size, ChannelDataStoreInt data, int immunity) |
Constructs and returns an Any2AnyChannel
object.
Constructs and returns an array of Any2AnyChannel
objects.
n the
- size of the array of channels.
Constructs and returns a Any2AnyChannel
object which
uses the specified ChannelDataStore
object as a buffer.
The buffer supplied to this method is cloned before it is inserted into the channel.
buffer the
- ChannelDataStore
to use.
Constructs and returns an array of Any2AnyChannel
objects
which use the specified ChannelDataStore
object as a
buffer.
The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
buffer the
- ChannelDataStore
to use.n
- the size of the array of channels. Constructs and returns an Any2OneChannel
object.
Constructs and returns an array of Any2OneChannel
objects.
n the
- size of the array of channels.
Constructs and returns a Any2OneChannel
object which
uses the specified ChannelDataStore
object as a buffer.
The buffer supplied to this method is cloned before it is inserted into the channel.
buffer the
- ChannelDataStore
to use.
Constructs and returns an array of Any2OneChannel
objects
which use the specified ChannelDataStore
object as a
buffer.
The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
buffer the
- ChannelDataStore
to use.n
- the size of the array of channels. Constructs and returns a One2AnyChannel
object.
Constructs and returns an array of One2AnyChannel
objects.
n the
- size of the array of channels.
Constructs and returns a One2AnyChannel
object which
uses the specified ChannelDataStore
object as a buffer.
The buffer supplied to this method is cloned before it is inserted into the channel.
buffer the
- ChannelDataStore
to use.
Constructs and returns an array of One2AnyChannel
objects
which use the specified ChannelDataStore
object as a
buffer.
The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
buffer the
- ChannelDataStore
to use.n
- the size of the array of channels. Constructs and returns a One2OneChannel
object.
Constructs and returns an array of One2OneChannel
objects.
n the
- size of the array of channels.
Constructs and returns a One2OneChannel
object which
uses the specified ChannelDataStore
object as a buffer.
The buffer supplied to this method is cloned before it is inserted into the channel.
buffer the
- ChannelDataStore
to use.
Constructs and returns an array of One2OneChannel
objects
which use the specified ChannelDataStore
object as a
buffer.
The buffer supplied to this method is cloned before it is inserted into the channel. This is why an array of buffers is not required.
buffer the
- ChannelDataStore
to use.n
- the size of the array of channels.
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
.
c
- the array of channel to obtain input ends from. 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
.
c
- the array of channel to obtain input ends from. 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
.
c
- the array of channel to obtain input ends from. 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
.
c
- the array of channel to obtain input ends from. 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
.
c
- the array of channel to obtain output ends from. 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
.
c
- the array of channel to obtain output ends from. 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
.
c
- the array of channel to obtain output ends from. 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
.
c
- the array of channel to obtain output ends from.