location.generators
Class FakeSatelliteInfoGenerator

java.lang.Object
  extended bylocation.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

Field Summary
(package private)  FakeGPSMonitor fgm
          The FakeGPSMonitor that the fake satellite information should be sent to.
(package private)  GpsInfoEvent gpsinfo
           
(package private)  int period
          The period in ms at which the sattelite information should change.
 
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
 

Field Detail

fgm

FakeGPSMonitor fgm
The FakeGPSMonitor that the fake satellite information should be sent to.


period

int period
The period in ms at which the sattelite information should change. Default is 5000ms.


gpsinfo

GpsInfoEvent gpsinfo
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