java.lang.Object
com.gluonhq.attach.position.Position

public final class Position extends 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

    Modifier and Type
    Method
    Description
    final double
    Return the altitude of the position, above mean sea level, in meters.
    final double
    Return the latitude coordinate of the position.
    final double
    Return the longitude coordinate of the position.
     

    Methods inherited from class java.lang.Object

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

    • 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 Details

    • 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 String toString()
      Overrides:
      toString in class Object