LRU (Least Recently Used) algorithm for the cache.
Since release 2.3 this class requires Java 1.4 to use the LinkedHashSet
. Use prior OSCache release which require the Jakarta commons-collections SequencedHashMap
class or the LinkedList
class if neither of the above classes are available.
No synchronization is required in this class since the AbstractConcurrentReadCache
already takes care of any synchronization requirements.
LinkedHashMap
. Synthesized and simplified from various published examples of the genre. The methods are not synchronized.
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.aspectj.org.eclipse.jdt.internal.core.util.ILRUCacheable
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
LinkedHashMap
. Synthesized and simplified from various published examples of the genre. The methods are not synchronized.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|