Class Bounds

java.lang.Object
es.situm.sdk.model.location.Bounds
All Implemented Interfaces:
android.os.Parcelable, MapperInterface

public class Bounds extends Object implements android.os.Parcelable, MapperInterface
Represents a rectangle bounds in a greographic 2D space Instances are immutable.
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<Bounds> CREATOR
  • Constructor Details

    • 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 Details

    • 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: MapperInterface
      Method to transform object into Map<String, Object>
      Specified by:
      toMap in interface MapperInterface
      Returns:
      Map<String, Object> with the information of the object mapped