|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcsp.util.ZeroBuffer
public class ZeroBuffer
This is used to create a zero-buffered object channel that never loses data.
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 FormField Summary |
---|
Fields inherited from interface org.jcsp.util.ChannelDataStore |
---|
EMPTY, FULL, NONEMPTYFULL |
Constructor Summary | |
---|---|
ZeroBuffer()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZeroBuffer()
Method Detail |
---|
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
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |