package pokus.sd;

import java.net.InetAddress;

public class Landmark {
	private static int counter;
	
	private double latitude = Double.NaN;
	private double longitude = Double.NaN;
	
	private int id = counter++;
	private boolean isFixed = false;
	
	private double distanceToHost = Double.POSITIVE_INFINITY;
	
	private InetAddress address;
	
	public Landmark(boolean isFixed) {
		this.isFixed = isFixed;
	}
	
	public Landmark(boolean isFixed, InetAddress address) {
		this.isFixed = isFixed;
		this.address = address;
	}
	
	public Landmark(boolean isFixed, InetAddress address, double latitude, double longitude) {
		this.isFixed = isFixed;
		this.address = address;
		this.latitude = latitude;
		this.longitude = longitude;
	}

	public boolean isKnownPosition() {
		return (latitude != Double.NaN && longitude != Double.NaN);
	}
	
	public boolean isFixed() {
		return this.isFixed;
	}
	
	public void setAddress(InetAddress address) {
		this.address = address;
	}
	
	public InetAddress getAddress() {
		return address;
	}
	
	public double getLatitude() {
		return latitude;
	}
	
	public double getLongitude() {
		return longitude;
	}

	public void setPosition(double lat, double lng) {
		latitude = lat;
		longitude = lng;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
		
	public void setDistanceToHost(double distance) {
		distanceToHost = distance;
	}
	
	public double getDistanceToHost() {
		return distanceToHost;
	}
}
