|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcsp.util.ZeroBuffer<T>
public class ZeroBuffer<T>
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 Form| Field 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. |
T |
get()
Returns the Object from the ZeroBuffer. |
int |
getState()
Returns the current state of the ZeroBuffer. |
void |
put(T value)
Puts a new Object into the ZeroBuffer. |
void |
removeAll()
Deletes all items in the buffer, leaving it empty. |
T |
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 T get()
Pre-condition: getState must not currently return EMPTY.
get in interface ChannelDataStore<T>public T startGet()
startGet in interface ChannelDataStore<T>ChannelDataStore.endGet()public void endGet()
endGet in interface ChannelDataStore<T>ChannelDataStore.startGet()public void put(T value)
Pre-condition: getState must not currently return FULL.
put in interface ChannelDataStore<T>value - the Object to put into the ZeroBufferpublic int getState()
getState in interface ChannelDataStore<T>public Object clone()
Note: Only the size and structure of the ZeroBuffer is cloned, not any stored data.
clone in interface ChannelDataStore<T>clone in class Objectpublic void removeAll()
ChannelDataStore
removeAll in interface ChannelDataStore<T>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||