org.epseelon.mobimap.util
Class GeoPosition

java.lang.Object
  extended by org.epseelon.mobimap.util.GeoPosition

public class GeoPosition
extends java.lang.Object

An immutable coordinate in the real (geographic) world, composed of a latitude and a longitude.

Author:
sarbogast

Constructor Summary
GeoPosition(double[] coords)
          Creates a new instance of GeoPosition from the specified latitude and longitude as an array of two doubles, with the latitude first.
GeoPosition(double latitude, double longitude)
          Creates a new instance of GeoPosition from the specified latitude and longitude.
GeoPosition(double latDegrees, double latMinutes, double latSeconds, double lonDegrees, double lonMinutes, double lonSeconds)
          Creates a new instance of GeoPosition from the specified latitude and longitude.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true the specified GeoPosition and this GeoPosition represent the exact same latitude and longitude coordinates.
 double getLatitude()
          Get the latitude as decimal degrees
 double getLongitude()
          Get the longitude as decimal degrees
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoPosition

public GeoPosition(double latitude,
                   double longitude)
Creates a new instance of GeoPosition from the specified latitude and longitude. These are double values in decimal degrees, not degrees, minutes, and seconds. Use the other constructor for those.

Parameters:
latitude - a latitude value in decmial degrees
longitude - a longitude value in decimal degrees

GeoPosition

public GeoPosition(double[] coords)
Creates a new instance of GeoPosition from the specified latitude and longitude as an array of two doubles, with the latitude first. These are double values in decimal degrees, not degrees, minutes, and seconds. Use the other constructor for those.

Parameters:
coords - latitude and longitude as a double array of length two

GeoPosition

public GeoPosition(double latDegrees,
                   double latMinutes,
                   double latSeconds,
                   double lonDegrees,
                   double lonMinutes,
                   double lonSeconds)
Creates a new instance of GeoPosition from the specified latitude and longitude. Each are specified as degrees, minutes, and seconds; not as decimal degrees. Use the other constructor for those.

Parameters:
latDegrees - the degrees part of the current latitude
latMinutes - the minutes part of the current latitude
latSeconds - the seconds part of the current latitude
lonDegrees - the degrees part of the current longitude
lonMinutes - the minutes part of the current longitude
lonSeconds - the seconds part of the current longitude
Method Detail

getLatitude

public double getLatitude()
Get the latitude as decimal degrees

Returns:
the latitude as decimal degrees

getLongitude

public double getLongitude()
Get the longitude as decimal degrees

Returns:
the longitude as decimal degrees

equals

public boolean equals(java.lang.Object obj)
Returns true the specified GeoPosition and this GeoPosition represent the exact same latitude and longitude coordinates.

Overrides:
equals in class java.lang.Object
Parameters:
obj - a GeoPosition to compare this GeoPosition to
Returns:
returns true if the specified GeoPosition is equal to this one

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
Returns:


Copyright © 2008 Epseelon. All Rights Reserved.