我需要TreeMap<Integer, T> map从头到尾迭代一遍.怎么办?
我在下面的帖子主题中尝试了与答案相同的内容:
new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
return o2.intValue() - o1.intValue();
}
}
Run Code Online (Sandbox Code Playgroud)
但这不是一个解决方案,只是扭转了秩序.
| 归档时间: |
|
| 查看次数: |
328 次 |
| 最近记录: |