Class Dimensions

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

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

      • CREATOR

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

      • Dimensions

        public Dimensions​(double width,
                          double height)
        width - in meters
        height - in meters
    • Method Detail

      • getWidth

        public double getWidth()
        Returns width of rectangle in meters
        double. Default is 0
      • getHeight

        public double getHeight()
        Returns height of rectangle in meters.
        double. Default is 0
      • contains

        public boolean contains​(double x,
                                double y)
        Check if the cartesian coordinates of a point are inside the dimension.
        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
        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​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        toString in class java.lang.Object
      • 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
        Map with the information of the object mapped