| 
CSP for Java (JCSP) 1.1-rc3  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jcsp.util.ints.OverWritingBufferInt
public class OverWritingBufferInt
This is used to create a buffered integer channel that always accepts input, overwriting its last entered data if full.
create methods of ChannelInt etc.
 The getState method returns EMPTY or NONEMPTYFULL, but never FULL.
ZeroBufferInt, 
BufferInt, 
OverWriteOldestBufferInt, 
OverFlowingBufferInt, 
InfiniteBufferInt, 
ChannelInt, 
Serialized Form| Field Summary | 
|---|
| Fields inherited from interface org.jcsp.util.ints.ChannelDataStoreInt | 
|---|
EMPTY, FULL, NONEMPTYFULL | 
| Constructor Summary | |
|---|---|
OverWritingBufferInt(int size)
Construct a new OverWritingBufferInt with the specified size.  | 
|
| Method Summary | |
|---|---|
 Object | 
clone()
Returns a new (and EMPTY) OverWritingBufferInt with the same creation parameters as this one.  | 
 void | 
endGet()
See startGet() for a description of the semantics of this method. | 
 int | 
get()
Returns the oldest int from the OverWritingBufferInt and removes it.  | 
 int | 
getState()
Returns the current state of the OverWritingBufferInt.  | 
 void | 
put(int value)
Puts a new int into the OverWritingBufferInt.  | 
 void | 
removeAll()
 | 
 int | 
startGet()
Begins an extended rendezvous by the reader.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public OverWritingBufferInt(int size)
size - the number of ints the OverWritingBufferInt 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.| Method Detail | 
|---|
public int get()
Pre-condition: getState must not currently return EMPTY.
get in interface ChannelDataStoreIntpublic int startGet()
OverWriteOldestBuffer.
 For a complete description, refer to the documentation for the OverWriteOldestBuffer.startGet() method.
startGet in interface ChannelDataStoreIntpublic void endGet()
startGet() for a description of the semantics of this method.
endGet in interface ChannelDataStoreIntstartGet()public void put(int value)
If OverWritingBufferInt is full, the last item previously put into the buffer will be overwritten.
put in interface ChannelDataStoreIntvalue - the int to put into the OverWritingBufferIntpublic int getState()
getState in interface ChannelDataStoreIntpublic Object clone()
Note: Only the size and structure of the OverWritingBufferInt 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-rc3  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||