com.partnersoft.gps.nmea
Class NmeaParserLib

java.lang.Object
  extended by com.partnersoft.gps.nmea.NmeaParserLib

public class NmeaParserLib
extends java.lang.Object

Here's how NmeaParserLib parses sentences: first, it ignores errors on a per-field basis. Blank fields are interpreted as 0. Second, it parses a sentence until the fields run out. If there aren't enough fields in a sentence, it uses all the fields it finds. The goal of this parsing strategy is to handle anything that even kind of looks like GPS data. It don't log errors when it finds them, and it is very permissive about what makes a valid sentence.

Author:
Russell Cagle Copyright 2007 Partner Software, Inc.

Field Summary
static int FIX_1D
           
static int FIX_2D
           
static int FIX_3D
           
static int FIX_DEAD_RECKONING
           
static int FIX_DIFF_GPS
           
static int FIX_FLOAT_RTK
           
static int FIX_GPS
           
static int FIX_INVALID
           
static int FIX_MANUAL_INPUT
           
static int FIX_PPS
           
static int FIX_REAL_TIME_KINEMATIC
           
static int FIX_SIMULATION
           
static java.lang.String MODE_AUTOMATIC
           
static java.lang.String MODE_MANUAL
           
static java.lang.String STATUS_ACTIVE
           
static java.lang.String STATUS_VOID
           
 
Method Summary
static double parseDouble(java.lang.String s)
          More tolerant for all the strange fields a GPS will hand us.
static int parseInt(java.lang.String s)
          More tolerant for all the strange fields a GPS will hand us.
static double parseLatitude(java.lang.String latitudeString, java.lang.String direction)
           
static double parseLongitude(java.lang.String longitudeString, java.lang.String direction)
           
static double parseUtc(java.lang.String utc)
          Returns the number of milliseconds that have elapsed in this day.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIX_INVALID

public static final int FIX_INVALID
See Also:
Constant Field Values

FIX_GPS

public static final int FIX_GPS
See Also:
Constant Field Values

FIX_DIFF_GPS

public static final int FIX_DIFF_GPS
See Also:
Constant Field Values

FIX_PPS

public static final int FIX_PPS
See Also:
Constant Field Values

FIX_REAL_TIME_KINEMATIC

public static final int FIX_REAL_TIME_KINEMATIC
See Also:
Constant Field Values

FIX_FLOAT_RTK

public static final int FIX_FLOAT_RTK
See Also:
Constant Field Values

FIX_DEAD_RECKONING

public static final int FIX_DEAD_RECKONING
See Also:
Constant Field Values

FIX_MANUAL_INPUT

public static final int FIX_MANUAL_INPUT
See Also:
Constant Field Values

FIX_SIMULATION

public static final int FIX_SIMULATION
See Also:
Constant Field Values

FIX_1D

public static final int FIX_1D
See Also:
Constant Field Values

FIX_2D

public static final int FIX_2D
See Also:
Constant Field Values

FIX_3D

public static final int FIX_3D
See Also:
Constant Field Values

MODE_MANUAL

public static final java.lang.String MODE_MANUAL
See Also:
Constant Field Values

MODE_AUTOMATIC

public static final java.lang.String MODE_AUTOMATIC
See Also:
Constant Field Values

STATUS_ACTIVE

public static final java.lang.String STATUS_ACTIVE
See Also:
Constant Field Values

STATUS_VOID

public static final java.lang.String STATUS_VOID
See Also:
Constant Field Values
Method Detail

parseDouble

public static double parseDouble(java.lang.String s)
More tolerant for all the strange fields a GPS will hand us. Ignores parsing errors and just returns a 0. Explicitly converts blanks to 0's.

Parameters:
s -
Returns:

parseInt

public static int parseInt(java.lang.String s)
More tolerant for all the strange fields a GPS will hand us. Ignores parsing errors and just returns a 0. Explicitly converts blanks to 0's.

Parameters:
s -
Returns:

parseLatitude

public static double parseLatitude(java.lang.String latitudeString,
                                   java.lang.String direction)

parseLongitude

public static double parseLongitude(java.lang.String longitudeString,
                                    java.lang.String direction)

parseUtc

public static double parseUtc(java.lang.String utc)
Returns the number of milliseconds that have elapsed in this day.

Parameters:
utc -
Returns: