The
LRUCache
is a hashtable that stores a finite number of elements. When an attempt is made to add values to a full cache, the least recently used values in the cache are discarded to make room for the new values as necessary.
The data structure is based on the LRU virtual memory paging scheme.
Objects can take up a variable amount of cache space by implementing the ILRUCacheable
interface.
This implementation is NOT thread-safe. Synchronization wrappers would have to be added to ensure atomic insertions and deletions from the cache.
@see org.eclipse.jdt.internal.core.util.ILRUCacheable