读书人

Google Guava集合2:Multi地图

发布时间: 2012-08-25 10:06:20 作者: rapoo

Google Guava集合2:Multimap
Multimap是guava中一个有用的工具类,下面我来介绍一下。

由来:
你是不是经常需要一个这样的数据结构:

ListMutlimap<String,String> myMutlimap = ArrayListMultimap.create();List<string> myValues = myMutlimap.get("myKey");  // Returns a List, not a Collection.



好了,基本就是这样,你可以参考API获取更多信息:http://docs.guava-libraries.googlecode.com/git-history/release09/javadoc/com/google/common/collect/Multimap.html

读书人网 >编程

热点推荐