package de.mrunde.bachelorthesis.basics;

import android.util.Log;

import com.mapquest.android.maps.GeoPoint;

/**
 * A StreetFurniture can be e.g. a roundabout or stop sign.
 * 
 * @author Marius Runde
 */
public class StreetFurniture {

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

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

	/**
	 * Constructor of the StreetFurniture class
	 * 
	 * @param center
	 *            Central position
	 * @param category
	 *            Category (must be from list of categories from
	 *            LandmarkCategory)
	 */
	public StreetFurniture(GeoPoint center, String category) {
		this.center = center;
		if (StreetFurnitureCategory.isCategory(category)) {
			this.category = category;
		} else {
			Log.e("StreetFurniture",
					"Category is not correct and will be set to null");
			this.category = null;
		}
	}

	public String toString() {
		return "Landmark({\"center\":{\"lat\":\"" + this.center.getLatitude()
				+ "\",\"lng\":\"" + this.center.getLongitude()
				+ "\"},\"category\":\"" + this.category + "\"});";
	}

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

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

@@ -1007,24 +1007,31 @@
 return %22
-Landmark
+StreetFurniture
 (%7B%5C%22cent
@@ -1043,25 +1043,30 @@
 %7B%5C%22lat%5C%22:%5C%22%22
- 
+%0D%0A%09%09%09%09
 + this.cente
@@ -1076,30 +1076,25 @@
 etLatitude()
-%0D%0A%09%09%09%09
+ 
 + %22%5C%22,%5C%22lng%5C
@@ -1094,25 +1094,30 @@
 ,%5C%22lng%5C%22:%5C%22%22
- 
+%0D%0A%09%09%09%09
 + this.cente
@@ -1132,22 +1132,17 @@
 gitude()
-%0D%0A%09%09%09%09
+ 
 + %22%5C%22%7D,%5C
@@ -1156,17 +1156,22 @@
 ry%5C%22:%5C%22%22
- 
+%0D%0A%09%09%09%09
 + this.c

Fix wrong String in toString method