public class Coordinate extends Object
To create a new instance:
Coordinate eiffelTower = Coordinate.lat(48.858093).lon(2.294694);Or, if you prefer to specify longitude first:
Coordinate eiffelTower = Coordinate.lon(2.294694).lat(48.858093);
Modifier and Type | Class and Description |
---|---|
static class |
Coordinate.CoordinateBuilderLatitude
A staged builder that holds a coordinate's latitude value.
|
static class |
Coordinate.CoordinateBuilderLongitude
A staged builder that holds a coordinate's longitude value.
|
Modifier and Type | Method and Description |
---|---|
double |
lat()
Returns the latitude of this coordinate.
|
static Coordinate.CoordinateBuilderLatitude |
lat(double lat)
Returns a new staged Coordinate builder, with the specified
latitude value.
|
double |
lon()
Returns the longitude of this coordinate.
|
static Coordinate.CoordinateBuilderLongitude |
lon(double lon)
Returns a new staged Coordinate builder, with the specified
longitude value.
|
static Coordinate |
ofLonLat(double lon,
double lat)
Creates a new
Coordinate with a longitude and a latitude. |
String |
toString() |
public static Coordinate ofLonLat(double lon, double lat)
Coordinate
with a longitude and a latitude.
To avoid confusing the order of the longitude and latitude parameters,
please use lat(double)
or lon(double)
instead.
lon
- the longitude of the coordinate.lat
- the latitude of the coordinate.Coordinate
.public double lon()
public double lat()
@Stability.Uncommitted public static Coordinate.CoordinateBuilderLatitude lat(double lat)
Complete the Coordinate by calling Coordinate.CoordinateBuilderLatitude.lon(double)
on the result. Example usage:
Coordinate eiffelTower = Coordinate.lat(48.858093).lon(2.294694);
@Stability.Uncommitted public static Coordinate.CoordinateBuilderLongitude lon(double lon)
Complete the Coordinate by calling Coordinate.CoordinateBuilderLongitude.lat(double)
on the result. Example usage:
Coordinate eiffelTower = Coordinate.lon(2.294694).lat(48.858093);
Copyright © 2024 Couchbase, Inc.. All rights reserved.