|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gavaghan.geodesy.GlobalCoordinates
public class GlobalCoordinates
Encapsulation of latitude and longitude coordinates on a globe. Negative latitude is southern hemisphere. Negative longitude is western hemisphere.
Any angle may be specified for longtiude and latitude, but all angles will be canonicalized such that:
-90 <= latitude <= +90 - 180 < longitude <= +180
Constructor Summary | |
---|---|
GlobalCoordinates(double latitude,
double longitude)
Construct a new GlobalCoordinates. |
Method Summary | |
---|---|
int |
compareTo(GlobalCoordinates other)
Compare these coordinates to another set of coordiates. |
boolean |
equals(java.lang.Object obj)
Compare these coordinates to another object for equality. |
double |
getLatitude()
Get latitude. |
double |
getLongitude()
Get longitude. |
int |
hashCode()
Get a hash code for these coordinates. |
void |
setLatitude(double latitude)
Set latitude. |
void |
setLongitude(double longitude)
Set longitude. |
java.lang.String |
toString()
Get coordinates as a string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GlobalCoordinates(double latitude, double longitude)
latitude
- latitude in degreeslongitude
- longitude in degreesMethod Detail |
---|
public double getLatitude()
public void setLatitude(double latitude)
latitude
- in degreespublic double getLongitude()
public void setLongitude(double longitude)
longitude
- in degreespublic int compareTo(GlobalCoordinates other)
compareTo
in interface java.lang.Comparable<GlobalCoordinates>
other
- instance to compare to
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
other
-
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |