Trull

edu.luc.cs.trull
Class AwaitOne

java.lang.Object
  extended by edu.luc.cs.trull.EmptyComponent
      extended by edu.luc.cs.trull.TerminatingComponent
          extended by edu.luc.cs.trull.AbstractComponent
              extended by edu.luc.cs.trull.AbstractCombinator
                  extended by edu.luc.cs.trull.Control
                      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.luc.cs.trull.Control
Control.BodyListener, Control.HandlerListener
 
Nested classes/interfaces inherited from class edu.luc.cs.trull.AbstractCombinator
AbstractCombinator.DefaultTerminationListener
 
Field Summary
 
Fields inherited from class edu.luc.cs.trull.Control
BODY, HANDLER
 
Fields inherited from class edu.luc.cs.trull.AbstractCombinator
components
 
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)
 
Method Summary
 
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 edu.luc.cs.trull.AbstractCombinator
addComponent, getComponent, getComponentCount, getComponents, removeAllComponents, removeComponent, removeComponent
 
Methods inherited from class edu.luc.cs.trull.AbstractComponent
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getExternalListeners, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from class edu.luc.cs.trull.TerminatingComponent
fireTermination, getParent, getTermEvent, scheduleTermination, setTerminationListener
 
Methods inherited from class edu.luc.cs.trull.EmptyComponent
getTerminationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.luc.cs.trull.PropertyChangeSource
addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from interface edu.luc.cs.trull.Terminating
getTerminationListener, setTerminationListener
 

Constructor Detail

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)


Trull

http://www.cs.luc.edu/trull/