IEqualityComparer interface in Java

后端 未结 4 1632
野性不改
野性不改 2021-02-13 12:27

More specifically I want an interface to compare objects which can be only compared for equality [e.g. complex numbers] but don\'t have total order on them. It should have [Not

4条回答
  •  春和景丽
    2021-02-13 12:47

    I would suggest using a function based approach to generate the buckets like the MultiMaps.index() method in Google collections (now Guava) does. They use a Function which maps objects of type V to keys of type K (in your case the buckets).

提交回复
热议问题