|
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.Objectorg.jcsp.util.ints.BufferInt
public class BufferInt
This is used to create a buffered integer channel that never loses data.
Channel
(Channel.one2oneInt(org.jcsp.util.ints.ChannelDataStoreInt) etc.).
The getState method returns EMPTY, NONEMPTYFULL or FULL according to the state of the buffer.
ZeroBufferInt,
OverWriteOldestBufferInt,
OverWritingBufferInt,
OverFlowingBufferInt,
InfiniteBufferInt,
ChannelInt,
Serialized Form| Field Summary |
|---|
| Fields inherited from interface org.jcsp.util.ints.ChannelDataStoreInt |
|---|
EMPTY, FULL, NONEMPTYFULL |
| Constructor Summary | |
|---|---|
BufferInt(int size)
Construct a new BufferInt with the specified size. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a new (and EMPTY) BufferInt with the same creation parameters as this one. |
void |
endGet()
Removes the oldest integer from the buffer. |
int |
get()
Returns the oldest int from the BufferInt and removes it. |
int |
getState()
Returns the current state of the BufferInt. |
void |
put(int value)
Puts a new int into the BufferInt. |
void |
removeAll()
|
int |
startGet()
Returns the oldest integer from the buffer but does not remove it. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferInt(int size)
size - the number of ints the BufferInt can store.
BufferIntSizeError - if size is negative. Note: no action
should be taken to try/catch this exception
- application code generating it is in error and needs correcting.| Method Detail |
|---|
public int get()
Pre-condition: getState must not currently return EMPTY.
get in interface ChannelDataStoreIntpublic int startGet()
startGet in interface ChannelDataStoreIntChannelDataStoreInt.endGet()public void endGet()
endGet in interface ChannelDataStoreIntChannelDataStoreInt.startGet()public void put(int value)
Pre-condition: getState must not currently return FULL.
put in interface ChannelDataStoreIntvalue - the int to put into the BufferIntpublic int getState()
getState in interface ChannelDataStoreIntpublic Object clone()
Note: Only the size and structure of the BufferInt is cloned, not any stored data.
clone in interface ChannelDataStoreIntclone in class Objectpublic void removeAll()
removeAll in interface ChannelDataStoreInt
|
CSP for Java (JCSP) 1.1-rc4 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||