开发者

What's the purpose of HashMap.Entry.recordAccess and recordRemoval?

开发者 https://www.devze.com 2023-02-08 21:12 出处:网络
If you take a look at the code for HashMap, you\'ll find empty methods called recordAccess and recordRemoval. What\'s the purpose开发者_JS百科 of these methods?They are overridden in LinkedHashMap\'s

If you take a look at the code for HashMap, you'll find empty methods called recordAccess and recordRemoval. What's the purpose开发者_JS百科 of these methods?


They are overridden in LinkedHashMap's Entry in order to maintain its linked list of entries.


It looks like the methods serve no direct purpose. However, if you were subclassing HashMap you could subclass the backing HashMap.Entry as well to receive such events easily.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号