public class LRUCache extends java.lang.Object implements ObjectCache
| Modifier and Type | Class and Description |
|---|---|
class |
LRUCache.ListeningLRUMap |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_SIZE
The default cache size (1000).
|
static java.lang.String |
LRU_CACHE_SIZE_PROPERTY
The property containing the maximum number of objects to cache.
|
| Constructor and Description |
|---|
LRUCache() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clear(java.io.Serializable key)
Clears an object from the cache by key.
|
void |
clearAll()
Clears the entire cache.
|
java.lang.Object |
get(java.io.Serializable key)
Gets an object from the cache by key, or returns null if that object is
not cached.
|
java.lang.String |
getType()
Gets the common name of the type of objects to cache.
|
void |
put(java.io.Serializable key,
java.lang.Object object)
Adds an object to the cache.
|
void |
setListener(LRUCacheListener l) |
void |
setSize(int newSize) |
void |
setType(java.lang.String type)
Sets the common name of the type of objects to cache.
|
public static final java.lang.String LRU_CACHE_SIZE_PROPERTY
public static final int DEFAULT_CACHE_SIZE
public void setSize(int newSize)
public java.lang.String getType()
ObjectCachegetType in interface ObjectCachepublic void setType(java.lang.String type)
ObjectCachesetType in interface ObjectCachepublic void put(java.io.Serializable key,
java.lang.Object object)
ObjectCacheput in interface ObjectCachepublic java.lang.Object get(java.io.Serializable key)
ObjectCacheget in interface ObjectCachepublic java.lang.Object clear(java.io.Serializable key)
ObjectCacheclear in interface ObjectCachepublic void clearAll()
ObjectCacheclearAll in interface ObjectCachepublic void setListener(LRUCacheListener l)