de.monarchy.guideme.util
Class PointOfInterest

java.lang.Object
  extended by de.monarchy.guideme.util.GeoCoordinate
      extended by de.monarchy.guideme.util.PointOfInterest
All Implemented Interfaces:
POI, java.io.Serializable
Direct Known Subclasses:
RoutePoint, WikipediaArticle

public class PointOfInterest
extends GeoCoordinate
implements POI

Specifies a location with a special name. The class PointOfInterest will be superclass of all points of interest, as its name says. The class itself can already be used as a simple location.

Author:
dstuerze
See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.monarchy.guideme.util.GeoCoordinate
DEG_TO_RAD, EARTH_RADIUS, RAD_TO_DEG
 
Constructor Summary
PointOfInterest(double lat, double lon, java.lang.String descr)
          Instanciates a PointOfInterest at the given location with the specified name.
PointOfInterest(GeoCoordinate g, java.lang.String descr)
          Instanciates a PointOfInterest at the given location with the specified name.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getDescription()
          Returns a description of the location in a String.
 GeoCoordinate getLocation()
          Returns the location as GeoCoordinate.
 View getView(Context c)
          A general PointOfInterest has no specified view.
 int hashCode()
           
 
Methods inherited from class de.monarchy.guideme.util.GeoCoordinate
distanceTo, getLatitude, getLongitude, setLatitude, setLongitude, toString, trackAngle
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.monarchy.guideme.util.POI
getLatitude, getLongitude
 

Constructor Detail

PointOfInterest

public PointOfInterest(double lat,
                       double lon,
                       java.lang.String descr)
Instanciates a PointOfInterest at the given location with the specified name.

Parameters:
lat - latitude of the POI
lon - longitude of the POI
descr - short description

PointOfInterest

public PointOfInterest(GeoCoordinate g,
                       java.lang.String descr)
Instanciates a PointOfInterest at the given location with the specified name.

Parameters:
g - location of the POI
descr - short description
Method Detail

getDescription

public java.lang.String getDescription()
Description copied from interface: POI
Returns a description of the location in a String.

Specified by:
getDescription in interface POI
Returns:
short description

getLocation

public GeoCoordinate getLocation()
Returns the location as GeoCoordinate. Although a PointOfInterest is already a subclass of GeoCoordinate, it will return a new instance of GeoCoordinate to hide its own informations and to prevent side effects.

Specified by:
getLocation in interface POI
Returns:
GeoCoordinate holding location information

getView

public View getView(Context c)
A general PointOfInterest has no specified view. Subclasses should override this method.

Specified by:
getView in interface POI
Parameters:
c - context for the view
Returns:
the view

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class GeoCoordinate

hashCode

public int hashCode()
Overrides:
hashCode in class GeoCoordinate