Class FilteredChannelFactory
- java.lang.Object
-
- org.jcsp.util.filter.FilteredChannelFactory
-
- All Implemented Interfaces:
BufferedChannelArrayFactory,BufferedChannelFactory,ChannelArrayFactory,ChannelFactory
public class FilteredChannelFactory extends Object implements ChannelFactory, ChannelArrayFactory, BufferedChannelFactory, BufferedChannelArrayFactory
This class is used for constructing Filtered Channels. The objects returned by instances of this class will implement the appropriate Filtered Channel interfaces even though the return types are not declared as being Filtered Channels. This is so that this class can implement the
ChannelFactoryandChannelArrayFactoryinterfaces. Instances of this class can therefore be used in place of the standard channel factory classes.A set of read and/or write filters can be specified so that all of the channels created by this factory will have the same buffering properties.
- Author:
- Quickstone Technologies Limited
-
-
Constructor Summary
Constructors Constructor Description FilteredChannelFactory()All channels constructed with a Factory constructed with this constructor will default to having no pre-installed filters.FilteredChannelFactory(Filter[] readFilters, Filter[] writeFilters)All channels constructed with this Factory instance will have the specifiedFilterobjects inserted into them.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Any2AnyChannelcreateAny2Any()Creates a new Any2Any channel with the filtering options set for this factory.Any2AnyChannel[]createAny2Any(int n)Constructs and returns an array ofAny2AnyChannelobjects.Any2AnyChannelcreateAny2Any(ChannelDataStore buffer)Creates a new Any2Any channel with the filtering options set for this factory and the specified data buffer.Any2AnyChannel[]createAny2Any(ChannelDataStore buffer, int n)Constructs and returns an array ofAny2AnyChannelobjects with a given buffering behaviour.Any2OneChannelcreateAny2One()Creates a new Any2One channel with the filtering options set for this factory.Any2OneChannel[]createAny2One(int n)Constructs and returns an array ofAny2OneChannelobjects.Any2OneChannelcreateAny2One(ChannelDataStore buffer)Creates a new Any2One channel with the filtering options set for this factory and the specified data buffer.Any2OneChannel[]createAny2One(ChannelDataStore buffer, int n)Constructs and returns an array ofAny2OneChannelobjects with a given buffering behaviour.One2AnyChannelcreateOne2Any()Creates a new One2Any channel with the filtering options set for this factory.One2AnyChannel[]createOne2Any(int n)Constructs and returns an array ofOne2AnyChannelobjects.One2AnyChannelcreateOne2Any(ChannelDataStore buffer)Creates a new One2Any channel with the filtering options set for this factory and the specified data buffer.One2AnyChannel[]createOne2Any(ChannelDataStore buffer, int n)Constructs and returns an array ofOne2AnyChannelobjects with a given buffering behaviour.One2OneChannelcreateOne2One()Creates a new One2One channel with the filtering options set for this factory.One2OneChannel[]createOne2One(int n)Constructs and returns an array ofOne2OneChannelobjects.One2OneChannelcreateOne2One(ChannelDataStore buffer)Creates a new One2One channel with the filtering options set for this factory and the specified data buffer.One2OneChannel[]createOne2One(ChannelDataStore buffer, int n)Constructs and returns an array ofOne2OneChannelobjects with a given buffering behaviour.
-
-
-
Constructor Detail
-
FilteredChannelFactory
public FilteredChannelFactory()
All channels constructed with a Factory constructed with this constructor will default to having no pre-installed filters.
-
FilteredChannelFactory
public FilteredChannelFactory(Filter[] readFilters, Filter[] writeFilters)
All channels constructed with this Factory instance will have the specified
Filterobjects inserted into them. The same instances of the filters will be inserted into each channel.Either of the parameters may be
nullif read/write filters are not required.- Parameters:
readFilters- optional read filters to install in new channels.writeFilters- optional write filters to install in new channels.
-
-
Method Detail
-
createOne2One
public One2OneChannel createOne2One()
Creates a new One2One channel with the filtering options set for this factory.- Specified by:
createOne2Onein interfaceChannelFactory- Returns:
- the created channel with the filters installed.
-
createAny2One
public Any2OneChannel createAny2One()
Creates a new Any2One channel with the filtering options set for this factory.- Specified by:
createAny2Onein interfaceChannelFactory- Returns:
- the created channel with the filters installed.
-
createOne2Any
public One2AnyChannel createOne2Any()
Creates a new One2Any channel with the filtering options set for this factory.- Specified by:
createOne2Anyin interfaceChannelFactory- Returns:
- the created channel with the filters installed.
-
createAny2Any
public Any2AnyChannel createAny2Any()
Creates a new Any2Any channel with the filtering options set for this factory.- Specified by:
createAny2Anyin interfaceChannelFactory- Returns:
- the created channel with the filters installed.
-
createOne2One
public One2OneChannel[] createOne2One(int n)
Constructs and returns an array ofOne2OneChannelobjects.- Specified by:
createOne2Onein interfaceChannelArrayFactory- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createOne2One(int)
-
createAny2One
public Any2OneChannel[] createAny2One(int n)
Constructs and returns an array ofAny2OneChannelobjects.- Specified by:
createAny2Onein interfaceChannelArrayFactory- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createAny2One(int)
-
createOne2Any
public One2AnyChannel[] createOne2Any(int n)
Constructs and returns an array ofOne2AnyChannelobjects.- Specified by:
createOne2Anyin interfaceChannelArrayFactory- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createOne2Any(int)
-
createAny2Any
public Any2AnyChannel[] createAny2Any(int n)
Constructs and returns an array ofAny2AnyChannelobjects.- Specified by:
createAny2Anyin interfaceChannelArrayFactory- Parameters:
n- the size of the array of channels.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createAny2Any(int)
-
createOne2One
public One2OneChannel createOne2One(ChannelDataStore buffer)
Creates a new One2One channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createOne2Onein interfaceBufferedChannelFactory- Parameters:
buffer- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createAny2One
public Any2OneChannel createAny2One(ChannelDataStore buffer)
Creates a new Any2One channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createAny2Onein interfaceBufferedChannelFactory- Parameters:
buffer- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createOne2Any
public One2AnyChannel createOne2Any(ChannelDataStore buffer)
Creates a new One2Any channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createOne2Anyin interfaceBufferedChannelFactory- Parameters:
buffer- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createAny2Any
public Any2AnyChannel createAny2Any(ChannelDataStore buffer)
Creates a new Any2Any channel with the filtering options set for this factory and the specified data buffer.- Specified by:
createAny2Anyin interfaceBufferedChannelFactory- Parameters:
buffer- the buffer implementation to use.- Returns:
- the created filtered channel.
-
createOne2One
public One2OneChannel[] createOne2One(ChannelDataStore buffer, int n)
Constructs and returns an array ofOne2OneChannelobjects with a given buffering behaviour.- Specified by:
createOne2Onein interfaceBufferedChannelArrayFactory- Parameters:
n- the size of the array of channels.buffer- the buffer implementation to use.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createOne2One(int)
-
createAny2One
public Any2OneChannel[] createAny2One(ChannelDataStore buffer, int n)
Constructs and returns an array ofAny2OneChannelobjects with a given buffering behaviour.- Specified by:
createAny2Onein interfaceBufferedChannelArrayFactory- Parameters:
n- the size of the array of channels.buffer- the buffer implementation to use.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createAny2One(int)
-
createOne2Any
public One2AnyChannel[] createOne2Any(ChannelDataStore buffer, int n)
Constructs and returns an array ofOne2AnyChannelobjects with a given buffering behaviour.- Specified by:
createOne2Anyin interfaceBufferedChannelArrayFactory- Parameters:
n- the size of the array of channels.buffer- the buffer implementation to use.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createOne2Any(int)
-
createAny2Any
public Any2AnyChannel[] createAny2Any(ChannelDataStore buffer, int n)
Constructs and returns an array ofAny2AnyChannelobjects with a given buffering behaviour.- Specified by:
createAny2Anyin interfaceBufferedChannelArrayFactory- Parameters:
n- the size of the array of channels.buffer- the buffer implementation to use.- Returns:
- the array of channels.
- See Also:
ChannelArrayFactory.createAny2Any(int)
-
-