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