java中map按照double大小进行排序,可以使用collentions接口的sort方法进行比较,实例如下:Collections.sort(dataMap, new Comparator>() { @Override public int compare(Map lhs, Map rhs) { Double d5 = ((Double) rhs.get(OpenPrice)); Double d6 = (Double) lhs.get(OpenPrice); if (d5 != null && d6 != null) { return d5.compareTo(d6); } else { return flag; } // return d1.compareTo(d2);}根据返回的int类型,可设置按照从大到小还是从小到大排序
建议你用treeMap