org.ka2ddo.gps
Class GPSParser

java.lang.Object
  extended by org.ka2ddo.gps.GPSParser

public class GPSParser
extends java.lang.Object

This class collects GPS data from GPS data sources and accumulates current position data for use by other parts of the application.


Field Summary
static boolean debug
          Flag to enable extra debugging stack traces for common cases that don't normally need stack traces.
 
Constructor Summary
GPSParser()
           
 
Method Summary
protected static boolean hasDigits(java.lang.String line, int startPos)
           
static java.lang.Object parseNMEA0183DataLine(java.lang.String line, GpsFix fix, SatelliteCatalog satCatalog, java.lang.String source)
          Parse an NMEA-0183 standard data sentence into GPS data structure values.
protected static java.lang.String[] split(java.lang.String line, char separator)
          This is a more optimized version of String.split() that doesn't require compiling and evaluating regular expression patterns to do it, thereby saving chunks of transient heap (and probably some CPU time as well).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Flag to enable extra debugging stack traces for common cases that don't normally need stack traces.

Constructor Detail

GPSParser

public GPSParser()
Method Detail

parseNMEA0183DataLine

public static java.lang.Object parseNMEA0183DataLine(java.lang.String line,
                                                     GpsFix fix,
                                                     SatelliteCatalog satCatalog,
                                                     java.lang.String source)
Parse an NMEA-0183 standard data sentence into GPS data structure values.

Parameters:
line - String line to parse
fix - GpsFix data structure to populate, or null if a new one should be allocated
satCatalog - SatelliteCatalog data structure to populate, or null if a new one should be allocated
source - callsign of source (used only for error messages)
Returns:
populated data structure if valid sentence parsed, "ASTRAL" if the sentence was a DeLorme TripMate trying to initialize, or null if parse failed

hasDigits

protected static boolean hasDigits(java.lang.String line,
                                   int startPos)

split

protected static java.lang.String[] split(java.lang.String line,
                                          char separator)
This is a more optimized version of String.split() that doesn't require compiling and evaluating regular expression patterns to do it, thereby saving chunks of transient heap (and probably some CPU time as well).

Parameters:
line - the String to split at occurrences of the separator
separator - the char delimiting substrings of the line
Returns:
array of Strings split at the various points the separator appears