FileDocCategorySizeDatePackage
Radar.javaAPI DocExample1414Sun Feb 13 17:12:30 GMT 2000gui2000

Radar

public class Radar extends Observable implements Runnable
The Radar class maintains contact with all the aircraft in a particular simulated airspace. At 2 second intervals it passes a Vector of AircraftData objects to its Observers.
author
T Balls
version
0.1, 12-12-99
see
gui2000.AirSpace
see
gui2000.AircraftData

Fields Summary
private Vector
aircraft
private Vector
aircraftData
private boolean
running
Constructors Summary
public Radar(Vector aircraft)

  this.aircraft = aircraft;
   
Methods Summary
public voidrun()

     
     while( running )
      {  aircraftData = new Vector();
         for( int i = 0; i < aircraft.size(); i++ )
         {  aircraftData.addElement( ((Aircraft)(aircraft.elementAt(i))).getData() );  
         }
         setChanged();
         notifyObservers( aircraftData );
         try
         {  Thread.sleep( 2000 );
         }
         catch( InterruptedException ie )
         {}                  
      }