0
我正在尝试对hazelcast中的列表(IList
)进行排序。我已经搜索过,无法找到一种方法来做到这一点。使用比较器对Hazelcast IList进行排序
请给我一些指导我如何排序它。 请注意,以下是不完整的,工作代码只是它的
IList hlist = hazelCastClient.getList("test") // hazelcastClient has been created already
hlist.add(message1)
hlist.add(message2)
hlist.add(message3)
Comparator comparator = new SomeComparator()
部分我如何使用比较重写比较功能排序此hazelcast名单。有没有其他的方法来排序榛树收集?
它返回一个扩展List的IList。我已经尝试了2种方法:hlist.sort(比较器) - 这一个失败 Collections.sort(hlist,comparator) - 这一个返回的结果,但没有根据比较定义排序 –
我不知道为什么你的比较器不是加工。刚刚阅读有关谓词,这也可以做排序我猜 - http://stackoverflow.com/questions/29968146/have-hazelcast-predicate-return-sorted-collection – Vasu