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>
CREATOR
static Dimensions
EMPTY
-
Constructor Summary
Constructors Constructor Description Dimensions(double width, double height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(double x, double y)
Check if the cartesian coordinates of a point are inside the dimension.int
describeContents()
boolean
equals(Object o)
double
getHeight()
Returns height of rectangle in meters.double
getWidth()
Returns width of rectangle in metersint
hashCode()
String
toString()
void
writeToParcel(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 aPoint
y
- 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:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-