Global Positioning System Reference
In-Depth Information
we leave them unchanged and instead inheritance is applied to extend the
existing classes and interfaces:
public interface GPSinfo extends Position
public class
GPSpoint extends GeoPoint impl. GPSinfo
public class
GPStrace extends Route
Inheritance is somewhat the opposite approach to that of a wrapper in
that it supplies all inherited methods of the inherited class as a starting
point. Then, each method can (or has to) be overridden in the development
process. Inheritance is often referred to as \is a" relation. A GPSinfo is a
Position and can directly make use of its methods. In the program flow, a
GPSinfo can be turned into a Position by simply casting it.
A programmer applying the classes of the roaf.gps package should un-
derstand the technique of casting. Casting does not create or modify ob-
jects; rather, it changes the type of a variable into another type as long as
the conversion makes sense. Objects are only created with the new operator
and remain untouched from casting.
Now, the classes and interfaces Position,GeoPoint , and Route can be
used to model geometry on the globe while GPSpoint and GPSinfo add the
time provided by a GPS device.
4.6.1
Universal Time
Global positioning relies on atomic-precision synchronized time and, as
such, every GPS device is a universal atomic-precision clock. Just as global
positioning raised the need for a unified model of the globe, unified time was
also necessary. It was defined in 1984 as the World Geodetic System (WGS-
84) and is based on international atomic time. Coordinated universal time
(UTC) can be considered one single clock (instance) running at a well-
defined place (the zero meridian).
Every (local) time stamp has a relationship to the UTC clock; A global
application has to be able to deal with timezones in order to coordinate
different events throughout the globe. UTC is sometimes referred to as
\GPS time," since this is the time reference of the GPS satellites.
The
Java Standard Edition provides the Date class 5 :
The class Date represents a specific instant in time, with millisecond
precision. ... the Date class is intended to reflect coordinated uni-
versal time (UTC) ... the Calendar class should be used to convert
between dates and time fields and the DateFormat class should be
used to format and parse date strings ... TimeZone represents a time
zone offset, and also figures out daylight savings.
5 download.oracle.com/javase/6/docs/api/java/util/Date.html
 
Search WWH ::




Custom Search