public class ZeroBufferInt extends java.lang.Object implements ChannelDataStoreInt, java.io.Serializable
Channel
(Channel.one2oneInt(org.jcsp.util.ints.ChannelDataStoreInt)
etc.).
The getState method will return FULL if there is an output waiting on the channel and EMPTY if there is not.
BufferInt
,
OverWriteOldestBufferInt
,
OverWritingBufferInt
,
OverFlowingBufferInt
,
InfiniteBufferInt
,
ChannelInt
,
Serialized FormEMPTY, FULL, NONEMPTYFULL
Constructor and Description |
---|
ZeroBufferInt() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a new (and EMPTY) ZeroBufferInt with the same
creation parameters as this one.
|
void |
endGet()
Ends the extended rendezvous by clearing the buffer.
|
int |
get()
Returns the int from the ZeroBufferInt.
|
int |
getState()
Returns the current state of the ZeroBufferInt.
|
void |
put(int value)
Puts a new int into the ZeroBufferInt.
|
void |
removeAll() |
int |
startGet()
Begins an extended rendezvous - simply returns the next integer in the buffer.
|
public int get()
Pre-condition: getState must not currently return EMPTY.
get
in interface ChannelDataStoreInt
public int startGet()
startGet
in interface ChannelDataStoreInt
ChannelDataStoreInt.endGet()
public void endGet()
endGet
in interface ChannelDataStoreInt
ChannelDataStoreInt.startGet()
public void put(int value)
Pre-condition: getState must not currently return FULL.
put
in interface ChannelDataStoreInt
value
- the int to put into the ZeroBufferIntpublic int getState()
getState
in interface ChannelDataStoreInt
public java.lang.Object clone()
Note: Only the size and structure of the ZeroBufferInt is cloned, not any stored data.
clone
in interface ChannelDataStoreInt
clone
in class java.lang.Object
public void removeAll()
removeAll
in interface ChannelDataStoreInt
Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.