001package systems.dmx.geomaps.model;
002
003
004
005public class GeoCoordinate {
006
007    // ---------------------------------------------------------------------------------------------- Instance Variables
008
009    public double lon, lat;
010
011    // ---------------------------------------------------------------------------------------------------- Constructors
012
013    public GeoCoordinate(double lon, double lat) {
014        this.lon = lon;
015        this.lat = lat;
016    }
017
018    /**
019     * Called by JAX-RS container to create a GeoCoordinate from a @QueryParam
020     */
021    public GeoCoordinate(String lonLat) {
022        String[] str = lonLat.split(",");
023        this.lon = Double.valueOf(str[0]);
024        this.lat = Double.valueOf(str[1]);
025    }
026
027    // -------------------------------------------------------------------------------------------------- Public Methods
028
029    @Override
030    public String toString() {
031        return "long=" + lon + ", lat=" + lat;
032    }
033}