📌  相关文章
📜  根据位置对列表进行排序 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:25.761000             🧑  作者: Mango

代码示例1
LonLat myHouse = /* whatever */ ;
Comparable comp = new Comparable () {
    LonLat a;
    int compareTo (Object b) {
        int aDist = calcDistance(a, myHouse) ;
        int bDist = calcDistance(b, myHouse) ;
        return aDist - bDist;
    }
};
myLonLatList.sort(lonLatList, comp);