Class GeoPt
- java.lang.Object
-
- com.google.appengine.api.datastore.GeoPt
-
- All Implemented Interfaces:
Serializable,Comparable<GeoPt>
public final class GeoPt extends Object implements Serializable, Comparable<GeoPt>
A geographical point, specified by float latitude and longitude coordinates. Often used to integrate with mapping sites like Google Maps.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static doubleEARTH_RADIUS_METERSstatic longserialVersionUID
-
Constructor Summary
Constructors Constructor Description GeoPt(float latitude, float longitude)Constructs aGeoPt.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(GeoPt o)Sort first by latitude, then by longitudebooleanequals(@Nullable Object o)floatgetLatitude()floatgetLongitude()inthashCode()StringtoString()
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
EARTH_RADIUS_METERS
public static final double EARTH_RADIUS_METERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeoPt
public GeoPt(float latitude, float longitude)Constructs aGeoPt.- Parameters:
latitude- The latitude. Must be between -90 and 90 (inclusive).longitude- The longitude. Must be between -180 and 180 (inclusive).- Throws:
IllegalArgumentException- Iflatitudeorlongitudeis outside the legal range.
-
-
Method Detail
-
getLatitude
public float getLatitude()
-
getLongitude
public float getLongitude()
-
compareTo
public int compareTo(GeoPt o)
Sort first by latitude, then by longitude- Specified by:
compareToin interfaceComparable<GeoPt>
-
-