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
CoordinateConverter
to convert betweenCoordinate
andCartesianCoordinate
's building coordinate.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<CartesianCoordinate>
CREATOR
static CartesianCoordinate
EMPTY
-
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 int
describeContents()
double
distanceTo(CartesianCoordinate cartesianCoordinate)
Calculates the distance (in meters) between this cartesian coordinate and anotherboolean
equals(Object o)
double
getX()
Returns value of coordinate at x-axisdouble
getY()
Returns value of coordinate at y-axisint
hashCode()
String
toString()
void
writeToParcel(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
- ifcartesianCoordinate
is null
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-