MultiMap vs MultiValue Map

后端 未结 4 1521
悲哀的现实
悲哀的现实 2021-01-17 21:40

At one place i have to use a map with many values mapped to a single key, so i was wondering whether there is any significant performance distinction between using H

4条回答
  •  悲&欢浪女
    2021-01-17 22:37

    If it is a Map Key-> Values, use a Map implementation.

    As you will have some Values with the same Keys, use the http://guava-libraries.googlecode.com/svn/tags/release09/javadoc/com/google/common/collect/HashMultiset.html from the Google Collection (now guava library, http://code.google.com/p/guava-libraries/ ) for your task.

提交回复
热议问题