org.placelab.spotter
Class StreamGPSSpotter

java.lang.Object
  extended byorg.placelab.spotter.AbstractSpotter
      extended byorg.placelab.spotter.NMEAGPSSpotter
          extended byorg.placelab.spotter.StreamGPSSpotter
All Implemented Interfaces:
Spotter
Direct Known Subclasses:
SerialJ9GPSSpotter

public abstract class StreamGPSSpotter
extends NMEAGPSSpotter

An NMEAGPSSpotter that provides default implementations for almost everything. All you need to provide is input and output streams to talk to the gps unit.


Constructor Summary
StreamGPSSpotter()
           
 
Method Summary
 void close()
          Unloads resources used by the spotter.
 void open(java.io.InputStream in, java.io.OutputStream out)
           
 void sendASentence(java.lang.String sentence)
          Send a sentence, complete with checksum, to the gps device.
protected  void startScanningImpl()
          Begin collecting and processing sentences from the gps device, handing them off to the NMEAGPSSpotter.lineAvailable(String) method as they are read in.
protected  void stopScanningImpl()
          Stop collecting sentences from the gps device
 
Methods inherited from class org.placelab.spotter.NMEAGPSSpotter
getMeasurement, lineAvailable, measurementAvailable, startScanning, startScanning, stopScanning
 
Methods inherited from class org.placelab.spotter.AbstractSpotter
addListener, notifyEndOfScan, notifyEndOfScan, notifyGotException, notifyGotException, notifyGotMeasurement, notifyGotMeasurement, removeListener, scanOnce, scanOnce, waitForThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.placelab.spotter.Spotter
open
 

Constructor Detail

StreamGPSSpotter

public StreamGPSSpotter()
Method Detail

open

public void open(java.io.InputStream in,
                 java.io.OutputStream out)
          throws SpotterException
Throws:
SpotterException

close

public void close()
           throws SpotterException
Description copied from interface: Spotter
Unloads resources used by the spotter. Multiple calls to close are ok.

Throws:
SpotterException

startScanningImpl

protected void startScanningImpl()
Description copied from class: NMEAGPSSpotter
Begin collecting and processing sentences from the gps device, handing them off to the NMEAGPSSpotter.lineAvailable(String) method as they are read in.

Specified by:
startScanningImpl in class NMEAGPSSpotter

stopScanningImpl

protected void stopScanningImpl()
Description copied from class: NMEAGPSSpotter
Stop collecting sentences from the gps device

Specified by:
stopScanningImpl in class NMEAGPSSpotter

sendASentence

public void sendASentence(java.lang.String sentence)
Description copied from class: NMEAGPSSpotter
Send a sentence, complete with checksum, to the gps device. Neither newline nor carraige return should be included.

Specified by:
sendASentence in class NMEAGPSSpotter