ro.isdc.wro.cache.impl
Class LruMemoryCacheStrategy<K,V>
java.lang.Object
ro.isdc.wro.cache.impl.MemoryCacheStrategy<K,V>
ro.isdc.wro.cache.impl.LruMemoryCacheStrategy<K,V>
- All Implemented Interfaces:
- CacheStrategy<K,V>
public class LruMemoryCacheStrategy<K,V>
- extends MemoryCacheStrategy<K,V>
This class implements a LRU (Least Recently Used) cache strategy. This cache
must have a fixed-size. When new entries are added and the cache reach its
maximum capacity, eldest entries are removed.
As all MemoryCacheStrategys this cache is thread-safe.
- Since:
- 1.3.6
- Author:
- Matias Mirabelli <matias.mirabelli@globant.com>
|
Field Summary |
static int |
DEFAULT_SIZE
Default cache size if no capacity is specified by the constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- Default cache size if no capacity is specified by the constructor.
- See Also:
- Constant Field Values
LruMemoryCacheStrategy
public LruMemoryCacheStrategy()
- Constructs a
LruMemoryCacheStrategy and sets the default size up
to DEFAULT_SIZE
LruMemoryCacheStrategy
public LruMemoryCacheStrategy(int cacheSize)
- Constructs a new
LruMemoryCacheStrategy and sets the cache size.
- Parameters:
cacheSize - Cache size. It must be greater than 0.
Copyright © 2008-2011. All Rights Reserved.