Class Bounds

  • All Implemented Interfaces:
    android.os.Parcelable, MapperInterface

    public class Bounds
    extends java.lang.Object
    implements android.os.Parcelable, MapperInterface
    Represents a rectangle bounds in a greographic 2D space Instances are immutable.
    • 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:
        java.lang.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
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> toMap()
        Description copied from interface: MapperInterface
        Method to transform object into Map
        Specified by:
        toMap in interface MapperInterface
        Returns:
        Map with the information of the object mapped