Class CartesianCoordinate

    • Constructor Detail

      • CartesianCoordinate

        public CartesianCoordinate​(double x,
                                   double y)
    • Method Detail

      • getX

        public double getX()
        Returns value of coordinate at x-axis
        Returns:
        double. Default is 0
      • getY

        public double getY()
        Returns value of coordinate at y-axis
        Returns:
        double. Default is 0
      • distanceTo

        @FloatRange(from=0.0)
        public double distanceTo​(CartesianCoordinate cartesianCoordinate)
                          throws java.lang.IllegalArgumentException
        Calculates the distance (in meters) between this cartesian coordinate and another
        Parameters:
        cartesianCoordinate - the other cartesian coordinate. Can't be null
        Returns:
        distance in meters. Never a negative value
        Throws:
        java.lang.IllegalArgumentException - if cartesianCoordinate is null
      • 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
      • fromMap

        public static CartesianCoordinate fromMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
                                           throws java.lang.IllegalArgumentException
        Return a new CartesianCoordinate instance object containing the data at the given map. Use MapperInterface to populate the Map. The expected fields are those defined at this class.
        Parameters:
        map - Map containing the data used to populate the new object.
        Returns:
        New instance.
        Throws:
        java.lang.IllegalArgumentException - If there is not enough information at the given map or it is incorrect.