-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWhat3Words.java
More file actions
49 lines (40 loc) · 1.09 KB
/
What3Words.java
File metadata and controls
49 lines (40 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package uk.ac.ed.inf;
/**
* Class defining the what3words location, parsing the json data in terms of its lnglat coordinates
*/
public class What3Words {
private final LngLat coordinates;
/**
* Constructor for what3 words class
* @param coordinates : lng and lat coordinate value of what3words location
*/
public What3Words(LngLat coordinates) {
this.coordinates = coordinates;
}
public LngLat getCoordinates() {
return coordinates;
}
/**
*
* Nested class for the formatting of what 3 words coordinates
*/
static class LngLat {
private final double lng;
private final double lat;
/**
* Class constructor for LngLat
* @param lng : longitude of what3words location
* @param lat :latitude of what3words location
*/
public LngLat(double lng, double lat) {
this.lng = lng;
this.lat = lat;
}
public double getLng() {
return lng;
}
public double getLat() {
return lat;
}
}
}