ConcurrentHashMap with weak keys and identity hash?

后端 未结 4 2057
没有蜡笔的小新
没有蜡笔的小新 2020-12-16 12:36

How do I get a ConcurrentHashMap with weak keys and identity hashes in Java? I think Google Guava Collections can give such a thing, but can I get it from the s

4条回答
  •  自闭症患者
    2020-12-16 13:27

    The Google Guava implementation appears the easiest way to go. One may initialize the required map with new MapMaker().weakKeys().makeMap() and use just as one would use java.util.concurrent.ConcurrentHashMap. See the apidoc for more details.

提交回复
热议问题