Package es.situm.sdk.model.location
Class CartesianCoordinate
- java.lang.Object
-
- es.situm.sdk.model.location.CartesianCoordinate
-
- All Implemented Interfaces:
android.os.Parcelable
public class CartesianCoordinate extends Object implements android.os.Parcelable
A structure that contains cartesian coordinate. Instances are immutable.See
CoordinateConverterto convert betweenCoordinateandCartesianCoordinate's building coordinate.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<CartesianCoordinate>CREATORstatic CartesianCoordinateEMPTY
-
Constructor Summary
Constructors Constructor Description CartesianCoordinate(double x, double y)CartesianCoordinate(CartesianCoordinate copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()doubledistanceTo(CartesianCoordinate cartesianCoordinate)Calculates the distance (in meters) between this cartesian coordinate and anotherbooleanequals(Object o)doublegetX()Returns value of coordinate at x-axisdoublegetY()Returns value of coordinate at y-axisinthashCode()StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY
public static final CartesianCoordinate EMPTY
-
CREATOR
public static final android.os.Parcelable.Creator<CartesianCoordinate> CREATOR
-
-
Constructor Detail
-
CartesianCoordinate
public CartesianCoordinate(double x, double y)
-
CartesianCoordinate
public CartesianCoordinate(@NonNull CartesianCoordinate copy)
-
-
Method Detail
-
getX
public double getX()
Returns value of coordinate at x-axis- Returns:
- double. Default is 0
-
getY
public double getY()
Returns value of coordinate at y-axis- Returns:
- double. Default is 0
-
distanceTo
public double distanceTo(CartesianCoordinate cartesianCoordinate) throws IllegalArgumentException
Calculates the distance (in meters) between this cartesian coordinate and another- Parameters:
cartesianCoordinate- the other cartesian 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
-
-