location.generators
Class FakeSatelliteInfoGenerator

java.lang.Object
  |
  +--location.generators.FakeSatelliteInfoGenerator
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class FakeSatelliteInfoGenerator
extends java.lang.Object
implements java.io.Serializable, java.lang.Runnable

Generates random fake satellite information.

Version:
1.0
Author:
Chien-Liang Fok
See Also:
Serialized Form

Constructor Summary
FakeSatelliteInfoGenerator(FakeGPSMonitor fgm)
           
 
Method Summary
protected  GpsInfoEvent genRandomGpsInfo()
          Generates a randome GpsInfoEvent.
 void run()
          Periodically changes the GpsInfoEvent being reported by the FakeGPSMonitor.
 void setPeriod(int period)
          Sets the period of updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeSatelliteInfoGenerator

public FakeSatelliteInfoGenerator(FakeGPSMonitor fgm)
Method Detail

setPeriod

public void setPeriod(int period)
Sets the period of updates.
Parameters:
period - the period in milliseconds

genRandomGpsInfo

protected GpsInfoEvent genRandomGpsInfo()
Generates a randome GpsInfoEvent. This will be sent to the FakeGPSMonitor. It randomly chooses between 5 and 15 satellites in view and 5 through n satellites in use where n is the number in view.
Returns:
a random GpsInfoEvent

run

public void run()
Periodically changes the GpsInfoEvent being reported by the FakeGPSMonitor.
Specified by:
run in interface java.lang.Runnable