Package org.jcsp.util
Class BufferSizeError
java.lang.Object
java.lang.Throwable
java.lang.Error
org.jcsp.util.BufferSizeError
- All Implemented Interfaces:
Serializable
This is thrown if an attempt is made to create some variety of buffered channel
with a zero or negative sized buffer.
Description
Buffered channels must have (usually non-zero) positive sized buffers. The following constructions will all throw thisError
:
One2OneChannel c = Channel.one2one (new Buffer (-42)); // must be >= 0 One2OneChannel c = Channel.one2one (new OverFlowingBuffer (-42)); // must be > 0 One2OneChannel c = Channel.one2one (new OverWriteOldestBuffer (-42)); // must be > 0 One2OneChannel c = Channel.one2one (new OverWritingBuffer (-42)); // must be > 0 One2OneChannel c = Channel.one2one (new InfiniteBuffer (-42)); // must be > 0Zero-buffered non-overwriting channels are, of course, the default channel semantics. The following constructions are all legal and equivalent:
One2OneChannel c = Channel.one2one (); One2OneChannel c = Channel.one2one (new ZeroBuffer ()); // less efficient One2OneChannel c = Channel.one2one (new Buffer (0)); // less efficientNo action should be taken to catch BufferSizeError. Application code generating it is in error and needs correcting.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BufferSizeError
-