-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocation.java
More file actions
41 lines (34 loc) · 984 Bytes
/
Copy pathLocation.java
File metadata and controls
41 lines (34 loc) · 984 Bytes
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
class Location implements Comparable<Location>{
final String NAME;
final double LATITUDE;
final double LONGITUDE;
public Location(String name, double lat, double lon){
this.NAME = name;
this.LATITUDE = lat;
this.LONGITUDE = lon;
}
/**
* Assign attached locations
*
* @param node - other location to be attached
*/
public String getName(){
return this.NAME;
}
public double getLatitude(){
return this.LATITUDE;
}
public double getLongitude(){
return this.LONGITUDE;
}
/**
* Compares this cart with the specified object for order.
*
* @return a negative integer, zero, or a positive integer as this cart has a cargo which is less
* than, equal to, or greater than the specified other cart's cargo.
*/
@Override
public int compareTo(Location other) {
return NAME.compareTo(other.NAME);
}
}