Class Position


  • public final class Position
    extends java.lang.Object
    A class that contains the latitude and longitude coordinates that map to a specific point location on earth.
    Since:
    3.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Position​(double latitude, double longitude)
      Construct a new position with the specified latitude and longitude.
      Position​(double latitude, double longitude, double altitude)
      Construct a new position with the specified latitude, longitude and altitude.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getAltitude()
      Return the altitude of the position, above mean sea level, in meters.
      double getLatitude()
      Return the latitude coordinate of the position.
      double getLongitude()
      Return the longitude coordinate of the position.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Position

        public Position​(double latitude,
                        double longitude)
        Construct a new position with the specified latitude and longitude. It sets the altitude as 0.0.
        Parameters:
        latitude - the latitude coordinate of the new position
        longitude - the longitude coordinate of the new position
      • Position

        public Position​(double latitude,
                        double longitude,
                        double altitude)
        Construct a new position with the specified latitude, longitude and altitude.
        Parameters:
        latitude - the latitude coordinate of the new position
        longitude - the longitude coordinate of the new position
        altitude - the altitude of the new position
    • Method Detail

      • getLatitude

        public final double getLatitude()
        Return the latitude coordinate of the position.
        Returns:
        a double representing the latitude coordinate
      • getLongitude

        public final double getLongitude()
        Return the longitude coordinate of the position.
        Returns:
        a double representing the longitude coordinate
      • getAltitude

        public final double getAltitude()
        Return the altitude of the position, above mean sea level, in meters.
        Returns:
        a double representing the altitude in meters
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object