edu.luc.cs.trull
Class AwaitOne
java.lang.Object
edu.luc.cs.trull.EmptyComponent
edu.luc.cs.trull.TerminatingComponent
edu.luc.cs.trull.AbstractComponent
edu.luc.cs.trull.AbstractCombinator
edu.luc.cs.trull.Control
edu.luc.cs.trull.AwaitOne
- All Implemented Interfaces:
- Combinator, Component, PropertyChangeSource, Startable, Suspendable, Terminating, java.beans.PropertyChangeListener, java.util.EventListener
- Direct Known Subclasses:
- Ship
public class AwaitOne
- extends Control
A disjunctive await.
A disjunctive await is an event-driven selection
mechanism that waits until an event corresponding
to one of the listed labels has occurred, executes
the corresponding action if present,
and continues as the associated component if present.
A disjunctive await terminates when the chosen component
terminates.
This combinator is a special case of the Control combinator.
- See Also:
Control
|
Constructor Summary |
AwaitOne()
Constructs an empty AwaitOne component. |
AwaitOne(java.lang.String[] startLabels,
Component body)
AwaitOne(startLabels, null, body) |
AwaitOne(java.lang.String[] startLabels,
Component[] branches)
Constructs an AwaitOne component whose body is a Switch with the
given branches. |
AwaitOne(java.lang.String[] startLabels,
java.beans.PropertyChangeListener startAction)
AwaitOne(startLabels, startAction, new Done()) |
AwaitOne(java.lang.String[] startLabels,
java.beans.PropertyChangeListener startAction,
Component body)
Constructs an AwaitOne component with the given array of triggering labels,
action to be invoked when one of the triggering events occurs, and component
to be started. |
AwaitOne(java.lang.String startLabel,
Component body)
AwaitOne([startLabel], body) |
AwaitOne(java.lang.String startLabel,
java.beans.PropertyChangeListener startAction)
AwaitOne([startLabel], startAction) |
AwaitOne(java.lang.String startLabel,
java.beans.PropertyChangeListener startAction,
Component body)
AwaitOne([startLabel], startAction, body) |
| Methods inherited from class edu.luc.cs.trull.Control |
addComponent, addComponent, getBody, getChildTerminationListener, getDefaultBody, getDefaultHandler, getHandler, getStartAction, getStartEvents, getStopAction, getStopEvents, propertyChange, resume, setBody, setHandler, setStartAction, setStartEvent, setStartEvents, setStartEvents, setStopAction, setStopEvent, setStopEvents, setStopEvents, start, startChild, stop, stopChild, suspend |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AwaitOne
public AwaitOne()
- Constructs an empty AwaitOne component.
Specific properties can be set later.
AwaitOne
public AwaitOne(java.lang.String[] startLabels,
Component body)
AwaitOne(startLabels, null, body)
AwaitOne
public AwaitOne(java.lang.String[] startLabels,
Component[] branches)
- Constructs an AwaitOne component whose body is a Switch with the
given branches. When a triggering event occurs, the branch
is chosen whose position corresponds to the position of the
triggering event in the array of event labels.
- Parameters:
startLabels - an array of triggering labels.branches - an array of components to branch to.
There must be as many components as labels.
AwaitOne
public AwaitOne(java.lang.String[] startLabels,
java.beans.PropertyChangeListener startAction)
AwaitOne(startLabels, startAction, new Done())
AwaitOne
public AwaitOne(java.lang.String[] startLabels,
java.beans.PropertyChangeListener startAction,
Component body)
- Constructs an AwaitOne component with the given array of triggering labels,
action to be invoked when one of the triggering events occurs, and component
to be started.
- Parameters:
startLabels - an array of triggering labels.startAction - the action to be invoked when a triggering event occurs. May be null.body - the component to be started after a triggering event occurs. If null, an empty component is used.
AwaitOne
public AwaitOne(java.lang.String startLabel,
Component body)
AwaitOne([startLabel], body)
AwaitOne
public AwaitOne(java.lang.String startLabel,
java.beans.PropertyChangeListener startAction)
AwaitOne([startLabel], startAction)
AwaitOne
public AwaitOne(java.lang.String startLabel,
java.beans.PropertyChangeListener startAction,
Component body)
AwaitOne([startLabel], startAction, body)
http://www.cs.luc.edu/trull/