public abstract class Guard
extends java.lang.Object
Alternative
events selectable by a process.
Alternative
. Its methods have
only package visibility within org.jcsp.lang and are of no concern to
users of this package. Currently, JCSP supports channel inputs, accepts,
timeouts and skips as guards.
Note: for those familiar with the occam multiprocessing language, classes implementing Guard correspond to process guards for use within ALT constructs.
CSTimer
,
Skip
,
AltingChannelInput
,
AltingChannelInputInt
,
Alternative
Constructor and Description |
---|
Guard() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract boolean |
disable()
Disables the guard for selection.
|
(package private) abstract boolean |
enable(Alternative alt)
Returns true if the event is ready.
|
protected void |
schedule(Alternative alt)
Schedules the process performing the given Alternative to run again.
|
abstract boolean enable(Alternative alt)
Note: this method should only be called by the Alternative class
alt
- the Alternative class that is controlling the selectionabstract boolean disable()
Note: this method should only be called by the Alternative class
protected void schedule(Alternative alt)
alt
- The Alternative to schedule