Class GeoPoint


  • public class GeoPoint
    extends java.lang.Object
    Represents geo point.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoPoint​(double latitude, double longitude)
      Create an instance of GeoPoint with the given latitude and longitude.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object rh)
      Return true when both latitude and longitude of given object are equal to this.
      double getLatitude()
      Return the latitude.
      double getLongitude()
      Return the longitude.
      int hashCode()  
      org.json.JSONObject toJSON()
      Returns JSON representation of this GeoPoint.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GeoPoint

        public GeoPoint​(double latitude,
                        double longitude)
        Create an instance of GeoPoint with the given latitude and longitude.
        Parameters:
        latitude - Latitude of the point in degrees. Valid if the value is greater than -90 degrees and less than +90 degrees.
        longitude - Longitude of the point in degrees. Valid if the value is greater than -180 degrees and less than +180 degrees.
        Throws:
        java.lang.IllegalArgumentException - when the specified argument is out of range.
    • Method Detail

      • toJSON

        @NonNull
        public org.json.JSONObject toJSON()
        Returns JSON representation of this GeoPoint.
        Returns:
        JSON representation of this GeoPoint.
      • getLatitude

        public double getLatitude()
        Return the latitude.
        Returns:
        latitude.
      • getLongitude

        public double getLongitude()
        Return the longitude.
        Returns:
        longitude.
      • equals

        public boolean equals​(@NonNull
                              java.lang.Object rh)
        Return true when both latitude and longitude of given object are equal to this.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - to compare against this.
        Returns:
        true when it is equal.
      • hashCode

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

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation(JSON) of this GeoPoint.
        See Also:
        toJSON()