【发布时间】:2014-05-08 08:02:43
【问题描述】:
假设我有这样的东西:
Multimap<Integer, Integer> data = TreeMultimap.create();
如何在我的数据上使用.headMap()?我想,TreeMultimap.asMap() 是要走的路。
文档 (link) 说,TreeMap.asMap() 返回 NavigableMap<K,Collection<V>>,但我无法让它工作。
NavigableMap<Integer, ArrayList<Integer>> test = data.asMap(); // type mismatch
SortedMap<Integer, ArrayList<Integer>> test = data.asMap(); // type mismatch
我做错了什么?
谢谢!
PS:我使用的是番石榴 16
【问题讨论】:
标签: java collections guava multimap