util
Class Position

java.lang.Object
  |
  +--util.Position

public class Position
extends java.lang.Object

This class represents a gps position location, a gps position contains the latitude, longitude, heading, and other information.


Field Summary
private  double heading
          The compass heading.
private  double lat
          Latitude.
private  double lng
          Longitude.
private  double speed
          The current movement speed determined by tracking and time.
private  long time
          The current world time for this timezone.
private  double track
          Tracking used in real gps, needed to determine heading.
 
Constructor Summary
Position()
          This constructor instantiates the GPS Position object with default values for the gps coordinate position.
 
Method Summary
 double getHeading()
          This method returns the heading.
 double getLatitude()
          This method returns the latitude.
 double getLongitude()
          This method returns the longitude.
 long getTime()
          This method returns the time.
 void setHeading(double h)
          This method sets the heading.
 void setLatitude(double l)
          This method sets the latitude.
 void setLongitude(double l)
          This method sets the longitude.
 void setTime(long time)
          This method sets the time.
 java.lang.String toString()
          This method returns a String of the GPS Position in a NMEA format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lat

private double lat
Latitude.


lng

private double lng
Longitude.


track

private double track
Tracking used in real gps, needed to determine heading.


speed

private double speed
The current movement speed determined by tracking and time.


time

private long time
The current world time for this timezone.


heading

private double heading
The compass heading.

Constructor Detail

Position

public Position()
This constructor instantiates the GPS Position object with default values for the gps coordinate position. All variables are set as the system gets them.

Method Detail

getTime

public long getTime()
This method returns the time.

Returns:
long The time in millisecons currently.

setTime

public void setTime(long time)
This method sets the time.

Parameters:
time - The time.

getHeading

public double getHeading()
This method returns the heading.

Returns:
double The heading as a double.

setHeading

public void setHeading(double h)
This method sets the heading.

Parameters:
h - The heading.

getLatitude

public double getLatitude()
This method returns the latitude.

Returns:
double The latitude.

setLatitude

public void setLatitude(double l)
This method sets the latitude.

Parameters:
l - The latitude.

getLongitude

public double getLongitude()
This method returns the longitude.

Returns:
double The longitude.

setLongitude

public void setLongitude(double l)
This method sets the longitude.

Parameters:
l - The longitude.

toString

public java.lang.String toString()
This method returns a String of the GPS Position in a NMEA format.

Overrides:
toString in class java.lang.Object
Returns:
String The nmea String for this Position object.