package de.mrunde.bachelorthesis.basics;

import android.util.Log;

import com.mapquest.android.maps.GeoPoint;

/**
 * The Landmark class represents local and global landmarks.
 * 
 * @author Marius Runde
 */
public class Landmark {

	/**
	 * Indicator for local or global landmark
	 */
	private boolean local;

	/**
	 * Title
	 */
	private String title;

	/**
	 * Central position
	 */
	private GeoPoint center;

	/**
	 * Category (must be from list of categories from LandmarkCategory)
	 */
	private String category;

	/**
	 * Constructor of the Landmark class
	 * 
	 * @param local
	 *            Indicator for local or global landmark
	 * @param title
	 *            Title
	 * @param center
	 *            Central position
	 * @param category
	 *            Category (must be from list of categories from
	 *            LandmarkCategory)
	 */
	public Landmark(boolean local, String title, GeoPoint center,
			String category) {
		this.local = local;
		this.title = title;
		this.center = center;

		// If the category is not correct, set it to -1
		if (LandmarkCategory.isCategory(category)) {
			this.category = category;
		} else {
			Log.e("Landmark", "Category is not correct and will be set to null");
			this.category = null;
		}
	}
	
	public String toString() {
		return "Landmark({\"local\":\"" + this.local + "\",\"title\":\""
				+ this.title + "\",\"center\":{\"lat\":\""
				+ this.center.getLatitude() + "\",\"lng\":\""
				+ this.center.getLongitude() + "\"},\"category\":\""
				+ this.category + "\"});";
	}

	/**
	 * @return The indicator whether this is a local or global landmark
	 */
	public boolean isLocal() {
		return local;
	}

	/**
	 * @return The title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return The central position
	 */
	public GeoPoint getCenter() {
		return center;
	}

	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}
}

@@ -431,24 +431,96 @@
  center;%0D%0A%0D%0A
+%09/**%0D%0A%09 * Radius of visibility in meters%0D%0A%09 */%0D%0A%09private int radius;%0D%0A%0D%0A
 %09/**%0D%0A%09 * Ca
@@ -575,32 +575,32 @@
 dmarkCategory)%0D%0A
-
 %09 */%0D%0A%09private S
@@ -834,16 +834,82 @@
 sition%0D%0A
+%09 * @param radius%0D%0A%09 *            Radius of visibility in meters%0D%0A
 %09 * @par
@@ -1086,16 +1086,28 @@
  center,
+ int radius,
 %0D%0A%09%09%09Str
@@ -1189,24 +1189,49 @@
 r = center;%0D
+%0A%09%09this.radius = radius;%0D
 %0A%0D%0A%09%09// If t
@@ -1475,11 +1475,10 @@
 %09%7D%0D%0A
-%09
 %0D%0A
+
 %09pub
@@ -1711,16 +1711,52 @@
  %22%5C%22%7D,%5C%22
+radius%5C%22:%22 + this.radius%0D%0A%09%09%09%09+ %22,%5C%22
 category
@@ -1757,30 +1757,25 @@
 tegory%5C%22:%5C%22%22
-%0D%0A%09%09%09%09
+ 
 + this.categ
@@ -2091,24 +2091,24 @@
 Center() %7B%0D%0A
-
 %09%09return cen
@@ -2111,32 +2111,143 @@
  center;%0D%0A%09%7D%0D%0A%0D%0A
+%09/**%0D%0A%09 * @return The radius of visibility in meters%0D%0A%09 */%0D%0A%09public int getRadius() %7B%0D%0A%09%09return radius;%0D%0A%09%7D%0D%0A%0D%0A
 %09/**%0D%0A%09 * @retur

Add radius information to the toString method of the Landmark class