|
CSP for Java (JCSP) 1.0-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for integer channel plug-ins that define their buffering characteristics.
This enables that logic to be varied by creating channels specifying
a particular implementation of this interface. This reduces the number of
classes that would otherwise need to be defined. The default channel
constructor (with no parameters) uses the ZeroBuffer implementation,
which gives the standard CSP semantics -- no buffering and full synchronisation
between reading and writing processes.
See the static
create
methods of One2OneChannelInt
etc.
Note: instances of ChannelDataStoreInt implementations are used by the various channel classes within jcsp.lang in a thread-safe way. They are not intended for any other purpose. Developers of new ChannelDataStoreInt implementations, therefore, do not need to worry about thread safety (e.g. by making its methods synchronized). Also, developers can assume that the documented pre-conditions for invoking the get and put methods will be met.
ZeroBufferInt
,
BufferInt
,
OverWriteOldestBufferInt
,
OverWritingBufferInt
,
OverFlowingBufferInt
,
InfiniteBufferInt
,
One2OneChannelInt
,
Any2OneChannelInt
,
One2AnyChannelInt
,
Any2AnyChannelInt
Field Summary | |
static int |
EMPTY
Indicates that the ChannelDataStoreInt is empty -- it can accept only a put. |
static int |
FULL
Indicates that the ChannelDataStoreInt is full -- it can accept only a get. |
static int |
NONEMPTYFULL
Indicates that the ChannelDataStoreInt is neither empty nor full -- it can accept either a put or a get call. |
Method Summary | |
Object |
clone()
Returns a new (and EMPTY) ChannelDataStoreInt with the same creation parameters as this one. |
int |
get()
Returns an int from the ChannelDataStoreInt. |
int |
getState()
Returns the current state of the ChannelDataStoreInt. |
void |
put(int value)
Puts a new int into the ChannelDataStoreInt. |
Field Detail |
public static final int EMPTY
public static final int NONEMPTYFULL
public static final int FULL
Method Detail |
public int getState()
public void put(int value)
Pre-condition: getState must not currently return FULL.
value
- the int to put into the ChannelDataStoreIntpublic int get()
Pre-condition: getState must not currently return EMPTY.
public Object clone()
Note: Only the size and structure of the ChannelDataStoreInt should be cloned, not any stored data.
clone
in class Object
|
CSP for Java (JCSP) 1.0-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |