What is the purpose of HashMap.Entry.recordAccess and recordRemoval?

If you look at the code for HashMap, you will find empty methods called recordAccess and recordRemoval. What is the purpose of these methods?

+3
source share
2 answers

They are redefined in LinkedHashMap Entryorder to maintain a linked list of records.

+9
source

It seems that the methods do not serve a direct purpose. However, if you were subclassed HashMap, you could subclass support HashMap.Entryto easily receive such events.

0
source

Source: https://habr.com/ru/post/1790528/


All Articles