public class ZeroBuffer extends Object implements ChannelDataStore, Serializable
Channel
(Channel.one2one(org.jcsp.util.ChannelDataStore)
etc.).
The getState method will return FULL if there is an output waiting on the channel and EMPTY if there is not.
Buffer
,
OverWriteOldestBuffer
,
OverWritingBuffer
,
OverFlowingBuffer
,
InfiniteBuffer
,
One2OneChannelImpl
,
Any2OneChannelImpl
,
One2AnyChannelImpl
,
Any2AnyChannelImpl
,
Serialized FormEMPTY, FULL, NONEMPTYFULL
Constructor and Description |
---|
ZeroBuffer() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a new (and EMPTY) ZeroBuffer with the same
creation parameters as this one.
|
void |
endGet()
Ends the extended rendezvous by clearing the buffer.
|
Object |
get()
Returns the Object from the ZeroBuffer.
|
int |
getState()
Returns the current state of the ZeroBuffer.
|
void |
put(Object value)
Puts a new Object into the ZeroBuffer.
|
void |
removeAll()
Deletes all items in the buffer, leaving it empty.
|
Object |
startGet()
Begins an extended rendezvous - simply returns the next object in the buffer.
|
public Object get()
Pre-condition: getState must not currently return EMPTY.
get
in interface ChannelDataStore
public Object startGet()
startGet
in interface ChannelDataStore
ChannelDataStore.endGet()
public void endGet()
endGet
in interface ChannelDataStore
ChannelDataStore.startGet()
public void put(Object value)
Pre-condition: getState must not currently return FULL.
put
in interface ChannelDataStore
value
- the Object to put into the ZeroBufferpublic int getState()
getState
in interface ChannelDataStore
public Object clone()
Note: Only the size and structure of the ZeroBuffer is cloned, not any stored data.
clone
in interface ChannelDataStore
clone
in class Object
public void removeAll()
ChannelDataStore
removeAll
in interface ChannelDataStore
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.