java集合排序
JSONArray itemsOfOneCate=//....
JSONArray 中装的JsonObject
Collections.sort(itemsOfOneCate, new Comparator<JSONObject>() { public int compare(JSONObject o1, JSONObject o2) { long sortValue1 = o1.optLong("sort_value"); long sortValue2 = o2.optLong("sort_value"); return sortValue1 - sortValue2 > 0 ? 1 : -1; } });