Algo Ramblings: LRUCache in java
The simplest way to create a cache using LinkedHashMap
is to extend it. The constructor takes as an argument the maximum number of entries we want a Cache object to hold. The superclass constructor has three arguments: the initial capacity of the map, the load factor, and a boolean argument that tells theLinkedHashMap
constructor to keep entries in access order instead of the default insertion order.
Read full article from Algo Ramblings: LRUCache in java
No comments:
Post a Comment