Popular Posts

Saturday, March 19, 2011

Implementing a Least-Recently-Used(LRU) Cache

LRU Cache helps you how to use the buffer and how to limit or fixed the size of buffer and how to manage storing and retrieving process of the buffer which size is limited.


   LRU Cache is implemented through the LinkedHashMap class.LinkedHashMap holds values with unique key. You you store values with a duplicate key then the LinkedHashMap replace the old value of that key with the new value of the key.

http://www.roseindia.net/java/example/java/util/LRUCacheExample.shtml

LinkedHashMap : http://download.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html

No comments:

Post a Comment