2013-03-25 48 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