2013-03-25 49 views
2

的地图如何为以下地图的地图指定比较如何指定比较了以下地图

ConcurrentSkipListMap<byte[], ConcurrentSkipListMap<byte[], ConcurrentSkipListMap<byte[], Object>>> myIndex; 

将下面的声明正确

myIndex = new ConcurrentSkipListMap<byte[], ConcurrentSkipListMap<byte[], ConcurrentSkipListMap<byte[], Object>>>(new MyCustomComparator) 

这会不会比较适用于内ConcurrentSkipListMap

+0

创建一个新的'比较器' – iberbeu 2013-03-25 08:56:49

+0

也许你应该重新考虑你的数据结构。如何为你的'Map Joshua 2013-03-25 09:03:24

回答

1

不,它不适用于内部ConcurrentSkipListMap。当您创建内部映射的实例时,您必须将它传递给内部ConcurrentSkipListMap()的构造函数。

+0

你怎么知道?我们似乎没有提及已命名的类的定义 - 它可能是确定的,谁知道...... – Bohemian 2013-03-25 09:21:51