de.monarchy.guideme.pois.wikipedia
Class WikipediaArticle

java.lang.Object
  extended by de.monarchy.guideme.util.GeoCoordinate
      extended by de.monarchy.guideme.util.PointOfInterest
          extended by de.monarchy.guideme.pois.wikipedia.WikipediaArticle
All Implemented Interfaces:
POI, WebPOI, java.io.Serializable

public class WikipediaArticle
extends PointOfInterest
implements WebPOI

WikipediaArticle is a special class to maintain information about points of interest gathered from wikipedia.

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
WikipediaArticle(double lat, double lon, java.lang.String descr, java.net.URL url)
          Creates a POI for wikipedia articles.
WikipediaArticle(double lat, double lon, java.lang.String descr, java.net.URL url, java.lang.String text)
          Creates a POI for wikipedia articles.
WikipediaArticle(GeoCoordinate gc, java.lang.String descr, java.net.URL url)
          Creates a POI for wikipedia articles.
WikipediaArticle(GeoCoordinate gc, java.lang.String descr, java.net.URL url, java.lang.String text)
          Creates a POI for wikipedia articles.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getContent()
          Returns the content of this article.
 java.net.URL getUrl()
          Returns the full URL of this article.
 View getView(Context c)
          A general PointOfInterest has no specified view.
 int hashCode()
           
 void setContent(java.lang.String text)
          Sets the content of this article to the given String.
 
Methods inherited from class de.monarchy.guideme.util.PointOfInterest
getDescription, getLocation
 
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
getDescription, getLatitude, getLocation, getLongitude
 

Constructor Detail

WikipediaArticle

public WikipediaArticle(double lat,
                        double lon,
                        java.lang.String descr,
                        java.net.URL url)
Creates a POI for wikipedia articles. As additional information, an url referring to the article has to be added.

Parameters:
lat - latitude of the POI
lon - longitude of the POI
descr - name of the article
url - article url

WikipediaArticle

public WikipediaArticle(GeoCoordinate gc,
                        java.lang.String descr,
                        java.net.URL url)
Creates a POI for wikipedia articles. As additional information, an url referring to the article has to be added.

Parameters:
gc - coordinate of the POI
descr - name of the article
url - article url

WikipediaArticle

public WikipediaArticle(double lat,
                        double lon,
                        java.lang.String descr,
                        java.net.URL url,
                        java.lang.String text)
Creates a POI for wikipedia articles. As additional information, an url referring to the article and a short piece of content should be added.

Parameters:
lat - latitude of the POI
lon - longitude of the POI
descr - name of the article
url - article url
text - short additional information about the POI

WikipediaArticle

public WikipediaArticle(GeoCoordinate gc,
                        java.lang.String descr,
                        java.net.URL url,
                        java.lang.String text)
Creates a POI for wikipedia articles. As additional information, an url referring to the article and a short piece of content should be added.

Parameters:
gc - coordinate of the POI
descr - name of the article
url - article url
text - short additional information about the POI
Method Detail

setContent

public void setContent(java.lang.String text)
Sets the content of this article to the given String.

Parameters:
text - new content

getContent

public java.lang.String getContent()
Returns the content of this article. As there is no error handling involved, possible return values include empty strings and null.

Returns:
content of the article if set, null else

getUrl

public java.net.URL getUrl()
Returns the full URL of this article.

Specified by:
getUrl in interface WebPOI
Returns:
url

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class PointOfInterest

getView

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

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