location
Class LocationEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--location.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

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
 

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.
Overrides:
equals in class java.lang.Object
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
Overrides:
toString in class java.util.EventObject
Returns:
a string

clone

public java.lang.Object clone()
This method returns a deep copy of this object.
Overrides:
clone in class java.lang.Object
Returns:
an object