cdx
Class DetectorControl

java.lang.Object
  extended by cdx.DetectorControl

public class DetectorControl
extends java.lang.Object

This class is used to control the execution of OutputCollisionsHandler. In particular, it ensures the release of this handler once all instances of DetectorHandler have finished their computational work.


Constructor Summary
DetectorControl(javax.safetycritical.AperiodicEvent event, int n)
          Constructor
 
Method Summary
protected  boolean done()
          Method to check whether all DetectorHandlers have finished.
 void notify(int id)
          Method to release OutputCollisionHandler if all DetectorHandlers have finihsed.
 void start()
          Method to record the state of each DetectorHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetectorControl

public DetectorControl(javax.safetycritical.AperiodicEvent event,
                       int n)
Constructor

Parameters:
event - the event to release OutputCollisionHandler
n - the number of DetectorHandler in parallel
Method Detail

start

public void start()
Method to record the state of each DetectorHandler. True if a DetectorHandler has finished, otherwise false


notify

public void notify(int id)
Method to release OutputCollisionHandler if all DetectorHandlers have finihsed.


done

protected boolean done()
Method to check whether all DetectorHandlers have finished.

Returns:
true if all have done, otherwise false.