CarLocation
@CarProtocol
public final class CarLocation
Represents a geographical location with a latitude and a longitude.
Summary
Public methods |
|
|---|---|
static @NonNull CarLocation |
Returns a new instance of a |
static @NonNull CarLocation |
create(double latitude, double longitude)Returns a new instance of a |
boolean |
|
double |
Returns the latitude of the location, in degrees. |
double |
Returns the longitude of the location, in degrees. |
int |
hashCode() |
String |
toString() |
Public methods
create
public static @NonNull CarLocation create(@NonNull Location location)
Returns a new instance of a CarLocation with the same latitude and longitude contained in the given Location.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
create
public static @NonNull CarLocation create(double latitude, double longitude)
Returns a new instance of a CarLocation.
getLatitude
public double getLatitude()
Returns the latitude of the location, in degrees.
getLongitude
public double getLongitude()
Returns the longitude of the location, in degrees.