location
Class LocationEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bylocation.LocationEvent
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class LocationEvent
extends java.util.EventObject
implements java.lang.Cloneable

This class encapsulates the events generated when the location changes.

Version:
3.0
Author:
Chien-Liang Fok
See Also:
Serialized Form

Field Summary
(package private)  double altitude
          The altitude in meters above sea level.
(package private)  double course
          The course in degrees.
(package private)  java.util.Date date
          The time the location was measured.
(package private)  boolean isValid
          Whether this LocationEvent contains valid information.
(package private)  Location location
          The location
(package private)  double speed
          The speed in meters per second.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LocationEvent(java.lang.Object source, Location newLocation, java.util.Date date, double speed, double altitude, double course, boolean isValid)
          The constructor.
 
Method Summary
 java.lang.Object clone()
          This method returns a deep copy of this object.
 boolean equals(java.lang.Object o)
          Determines if another object is equal to this LocationEvent.
 double getAltitude()
          Returns tha altitude in meters above sea level.
 double getCourse()
          Returns the course in degrees.
 java.util.Date getDate()
          Returns the time stamp of this location.
 Location getLocation()
          Returns the current location.
 double getSpeed()
          Returns the speed in meters per second.
 boolean isValid()
          Accessor method to flag isValid.
 java.lang.String toString()
          Gives a string representation of the object
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

Location location
The location


date

java.util.Date date
The time the location was measured.


speed

double speed
The speed in meters per second.


altitude

double altitude
The altitude in meters above sea level.


course

double course
The course in degrees.


isValid

boolean isValid
Whether this LocationEvent contains valid information.

Constructor Detail

LocationEvent

public LocationEvent(java.lang.Object source,
                     Location newLocation,
                     java.util.Date date,
                     double speed,
                     double altitude,
                     double course,
                     boolean isValid)
The constructor.

Parameters:
source - the event source
newLocation - the new location
speed - the speed in meters per second
altitude - the altitude in meters above sea level
course - the course in degrees
isValid - true if the included data is a valid measurement (Initially, the RealGPS will not provide valid measurements).
Method Detail

equals

public boolean equals(java.lang.Object o)
Determines if another object is equal to this LocationEvent. An object is equal to this one if it is of type LocationEvent and its location, date, speed, altitude, course, validity are the same as this one.

Returns:
true if another object is equal to this one

getLocation

public Location getLocation()
Returns the current location.

Returns:
the location

getDate

public java.util.Date getDate()
Returns the time stamp of this location.

Returns:
the time the location was measured

getSpeed

public double getSpeed()
Returns the speed in meters per second.

Returns:
the speed

getAltitude

public double getAltitude()
Returns tha altitude in meters above sea level.

Returns:
the altitude

getCourse

public double getCourse()
Returns the course in degrees.

Returns:
the course

isValid

public boolean isValid()
Accessor method to flag isValid.

Returns:
true if the location is valid.

toString

public java.lang.String toString()
Gives a string representation of the object

Returns:
a string

clone

public java.lang.Object clone()
This method returns a deep copy of this object.

Returns:
an object