Package es.situm.sdk.model.location
Class Dimensions
- java.lang.Object
-
- es.situm.sdk.model.location.Dimensions
-
- All Implemented Interfaces:
android.os.Parcelable
public class Dimensions extends Object implements android.os.Parcelable
Define 2D dimensions of a rectangular area. Instances are immutable.
-
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<Dimensions>CREATORstatic DimensionsEMPTY
-
Constructor Summary
Constructors Constructor Description Dimensions(double width, double height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)Check if the cartesian coordinates of a point are inside the dimension.intdescribeContents()booleanequals(Object o)doublegetHeight()Returns height of rectangle in meters.doublegetWidth()Returns width of rectangle in metersinthashCode()StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY
public static final Dimensions EMPTY
-
CREATOR
public static final android.os.Parcelable.Creator<Dimensions> CREATOR
-
-
Method Detail
-
getWidth
public double getWidth()
Returns width of rectangle in meters- Returns:
- double. Default is 0
-
getHeight
public double getHeight()
Returns height of rectangle in meters.- Returns:
- double. Default is 0
-
contains
public boolean contains(double x, double y)Check if the cartesian coordinates of a point are inside the dimension.- Parameters:
x- value in meters (usually this is related with the x cartesian coordinate of aPointy- value in meters (usually this is related with the y cartesian coordinate of aPoint- Returns:
- boolean value that indicates if the coordinates are inside the dimensions. true means it belongs the dimension, false means it does not belong the dimension.
-
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
-
-