Package es.situm.sdk.model.location
Class Coordinate
- java.lang.Object
-
- es.situm.sdk.model.location.Coordinate
-
- All Implemented Interfaces:
android.os.Parcelable
public class Coordinate extends Object implements android.os.Parcelable
A structure that contains geographical coordinate. Instances are immutable.See
CoordinateConverterto convert betweenCoordinateandCartesianCoordinate's building coordinate.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<Coordinate>CREATORstatic CoordinateEMPTY
-
Constructor Summary
Constructors Constructor Description Coordinate(double latitude, double longitude)Coordinate(Coordinate copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()doubledistanceTo(Coordinate coordinate)Calculates the distance (in meters) between this coordinate and anotherbooleanequals(Object o)doublegetLatitude()Returns latitude in degreesdoublegetLongitude()Returns longitude in degreesinthashCode()StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Coordinate> CREATOR
-
EMPTY
public static final Coordinate EMPTY
-
-
Constructor Detail
-
Coordinate
public Coordinate(double latitude, double longitude)
-
Coordinate
public Coordinate(@NonNull Coordinate copy)
-
-
Method Detail
-
getLatitude
public double getLatitude()
Returns latitude in degrees- Returns:
- double. Default is 0
-
getLongitude
public double getLongitude()
Returns longitude in degrees- Returns:
- double. Default is 0
-
distanceTo
public double distanceTo(Coordinate coordinate) throws IllegalArgumentException
Calculates the distance (in meters) between this coordinate and another- Parameters:
coordinate- the other coordinate. Can't be null- Returns:
- distance in meters. Never a negative value
- Throws:
IllegalArgumentException- ifcartesianCoordinateis null
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
-