public class OverFlowingBufferInt extends java.lang.Object implements ChannelDataStoreInt, java.io.Serializable
Channel
(Channel.one2oneInt(org.jcsp.util.ints.ChannelDataStoreInt) etc.).
The getState method returns EMPTY or NONEMPTYFULL, but never FULL.
ZeroBufferInt,
BufferInt,
OverWriteOldestBufferInt,
OverWritingBufferInt,
InfiniteBufferInt,
ChannelInt,
Serialized FormEMPTY, FULL, NONEMPTYFULL| Constructor and Description |
|---|
OverFlowingBufferInt(int size)
Construct a new OverFlowingBufferInt with the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a new (and EMPTY) OverFlowingBufferInt 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 OverFlowingBufferInt and removes it.
|
int |
getState()
Returns the current state of the OverFlowingBufferInt.
|
void |
put(int value)
Puts a new int into the OverFlowingBufferInt.
|
void |
removeAll() |
int |
startGet()
Returns the oldest integer from the buffer but does not remove it.
|
public OverFlowingBufferInt(int size)
size - the number of ints the OverFlowingBufferInt can store.BufferIntSizeError - if size is zero or negative. Note: no action
should be taken to try/catch this exception
- application code generating it is in error and needs correcting.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)
If OverFlowingBufferInt is full, the item is discarded.
put in interface ChannelDataStoreIntvalue - the int to put into the OverFlowingBufferIntpublic int getState()
getState in interface ChannelDataStoreIntpublic java.lang.Object clone()
Note: Only the size and structure of the OverFlowingBufferInt is cloned, not any stored data.
clone in interface ChannelDataStoreIntclone in class java.lang.Objectpublic void removeAll()
removeAll in interface ChannelDataStoreIntCopyright © 1996–2022. All rights reserved.