Of course this means you need an additional object for every entry in your map. Thus I think a map implementation like you suggest would be nice to have.
I am aware that youre not asking for this specifically, so here goes: If all you want is a Map with a custom equivalence function you may be able to achieve the same by using the standard TreeMap that takes a custom Comparator.
据我所知,没有。
但是您可以将所有密钥包装在
Equivalence.Wrapper
实例使用等效
您需要的策略:当然,这意味着您地图中的每个条目都需要一个额外的对象。因此,我认为像您建议的那样的地图实现会很好。
As far as I know, no.
But you can wrap all your keys in
Equivalence.Wrapper
instances using theEquivalence
strategy you need:Of course this means you need an additional object for every entry in your map. Thus I think a map implementation like you suggest would be nice to have.