开发者

Primitive ordered collection in java

Trove library provides some fast primitive collections, eg Map, List, but it does not have any ordered collection, eg SortedMap, T开发者_如何学PythonreeSet. Is there a library that provides those collections?


Try http://fastutil.dsi.unimi.it/ for some giant ordered structures, but perhaps not all that you want.


There is also LinkedMap and ListOrderedMap from the Common Collection library.

OrderedMap map = new LinkedMap();
map.put("FIVE", "5");
map.put("SIX", "6");
map.put("SEVEN", "7");
map.firstKey();  // returns "FIVE"
map.nextKey("FIVE");  // returns "SIX"
map.nextKey("SIX");  // returns "SEVEN"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜