|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jmage.cache.LRUMemoryCache
public class LRUMemoryCache
LRU Cache dismisses the least recently used object in the cache upon adding new ones, once the cache's capacity has been met.
| Field Summary | |
|---|---|
protected int |
capacity
|
protected static org.apache.log4j.Logger |
log
|
protected java.util.LinkedHashMap |
pages
|
| Constructor Summary | |
|---|---|
LRUMemoryCache()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy the cache |
protected int |
getCapacity()
|
protected int |
getSize()
|
void |
init(java.util.Properties properties)
Initialize the cache using Properties |
void |
pageIn(java.lang.Object key,
java.lang.Object object)
Pages an object into the cache, affecting it's cache ranking. |
java.lang.Object |
pageOut(java.lang.Object key)
Pages an object out of the cache, affecting it's cache ranking. |
void |
remove(java.lang.Object object)
Removes an object from the cache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.LinkedHashMap pages
protected int capacity
protected static org.apache.log4j.Logger log
| Constructor Detail |
|---|
public LRUMemoryCache()
| Method Detail |
|---|
public void init(java.util.Properties properties)
throws CacheException
Cache
init in interface CacheCacheException
public void pageIn(java.lang.Object key,
java.lang.Object object)
throws CacheException
Cache
pageIn in interface Cachekey - the keyobject - the object
CacheException
public java.lang.Object pageOut(java.lang.Object key)
throws CacheException
Cache
pageOut in interface Cachekey - the object's cache key
CacheExceptionpublic void remove(java.lang.Object object)
Cache
remove in interface Cacheobject - the object's cache key
public void destroy()
throws CacheException
Cache
destroy in interface CacheCacheExceptionprotected int getCapacity()
protected int getSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||