Package es.situm.sdk.model.location
Class Bounds
- java.lang.Object
-
- es.situm.sdk.model.location.Bounds
-
- All Implemented Interfaces:
android.os.Parcelable
public class Bounds extends Object implements android.os.Parcelable
Represents a rectangle bounds in a greographic 2D space Instances are immutable.
-
-
Constructor Summary
Constructors Constructor Description Bounds(Coordinate[] coordinates)Creates a rectangular Bound given the the geographic coordinate of the 4 corners.Bounds(Coordinate southWest, Coordinate northEast, Coordinate northWest, Coordinate southEast)Creates a rectangular Bound given the the geographic coordinate of the 4 corners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)CoordinategetNorthEast()Returns the coordinate of the north-east corner of the bound.CoordinategetNorthWest()Returns the coordinate of the north-west corner of the bound.CoordinategetSouthEast()Returns the coordinate of the south-east corner of the bound.CoordinategetSouthWest()Returns the coordinate of the south-east corner of the bound.inthashCode()StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Bounds> CREATOR
-
-
Constructor Detail
-
Bounds
public Bounds(@NonNull Coordinate southWest, @NonNull Coordinate northEast, @NonNull Coordinate northWest, @NonNull Coordinate southEast)Creates a rectangular Bound given the the geographic coordinate of the 4 corners.- Parameters:
southWest- e.g (0,0)northEast- e.g (w,h)northWest- e.g (0,h)southEast- e.g (w,0)- Throws:
IllegalArgumentException- if some parameter is null
-
Bounds
public Bounds(@NonNull Coordinate[] coordinates)Creates a rectangular Bound given the the geographic coordinate of the 4 corners.- Parameters:
coordinates- array with 4 non-null the geographic coordinate, ordered {southWest, northEast, northWest, southEast}.e.g {(0,0), (w,h), (0,h), (w,0)}
-
-
Method Detail
-
getNorthWest
@NonNull public Coordinate getNorthWest()
Returns the coordinate of the north-west corner of the bound.- Returns:
Coordinate
-
getNorthEast
@NonNull public Coordinate getNorthEast()
Returns the coordinate of the north-east corner of the bound.- Returns:
Coordinate
-
getSouthEast
@NonNull public Coordinate getSouthEast()
Returns the coordinate of the south-east corner of the bound.- Returns:
Coordinate
-
getSouthWest
@NonNull public Coordinate getSouthWest()
Returns the coordinate of the south-east corner of the bound.- Returns:
Coordinate
-
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
-
-