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 int
describeContents()
boolean
equals(Object o)
Coordinate
getNorthEast()
Returns the coordinate of the north-east corner of the bound.Coordinate
getNorthWest()
Returns the coordinate of the north-west corner of the bound.Coordinate
getSouthEast()
Returns the coordinate of the south-east corner of the bound.Coordinate
getSouthWest()
Returns the coordinate of the south-east corner of the bound.int
hashCode()
String
toString()
void
writeToParcel(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:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-