开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜