public final class GeoLocation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
latitude
The latitude of this location in the range of [-90, 90]
|
double |
longitude
The longitude of this location in the range of [-180, 180]
|
Constructor and Description |
---|
GeoLocation(double latitude,
double longitude)
Creates a new GeoLocation with the given latitude and longitude.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
coordinatesValid(double latitude,
double longitude)
Checks if these coordinates are valid geo coordinates.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
java.lang.String |
toString() |
public final double latitude
public final double longitude
public GeoLocation(double latitude, double longitude)
latitude
- The latitude in the range of [-90, 90]longitude
- The longitude in the range of [-180, 180]java.lang.IllegalArgumentException
- If the coordinates are not valid geo coordinatespublic static boolean coordinatesValid(double latitude, double longitude)
latitude
- The latitude must be in the range [-90, 90]longitude
- The longitude must be in the range [-180, 180]public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object