Class Dimensions

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

public class Dimensions extends Object implements android.os.Parcelable, MapperInterface
Define 2D dimensions of a rectangular area. Instances are immutable.
  • Field Details

    • EMPTY

      public static final Dimensions EMPTY
    • CREATOR

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

    • Dimensions

      public Dimensions(double width, double height)
      Parameters:
      width - in meters
      height - in meters
  • Method Details

    • 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 a Point
      y - value in meters (usually this is related with the y cartesian coordinate of a Point
      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 interface android.os.Parcelable
    • 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
    • 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