java 對坐標(biāo)排序
```java
public class Coordinate implements Comparable
private double latitude;
private double longitude;
public int compareTo(Coordinate other) {
if (this.latitude < other.latitude) {
return -;
} else if (this.latitude > other.latitude) {
return ;
} else {
if (this.longitude < other.longitude) {
return -;
} else if (this.longitude > other.longitude) {
return ;
} else {
return ;
}
}
}
}
```
```java
List
Collections.sort(coordinates);
```