- java.lang.Object
-
- com.gluonhq.attach.position.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 specifiedlatitude
andlongitude
.Position(double latitude, double longitude, double altitude)
Construct a new position with the specifiedlatitude
,longitude
andaltitude
.
-
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()
-
-
-
Constructor Detail
-
Position
public Position(double latitude, double longitude)
Construct a new position with the specifiedlatitude
andlongitude
. It sets thealtitude
as 0.0.- Parameters:
latitude
- the latitude coordinate of the new positionlongitude
- the longitude coordinate of the new position
-
Position
public Position(double latitude, double longitude, double altitude)
Construct a new position with the specifiedlatitude
,longitude
andaltitude
.- Parameters:
latitude
- the latitude coordinate of the new positionlongitude
- the longitude coordinate of the new positionaltitude
- 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 classjava.lang.Object
-
-