|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Cache
CacheException
public void pageIn(java.lang.Object key, java.lang.Object object) throws CacheException
Cache
pageIn
in interface Cache
key
- the keyobject
- the object
CacheException
public java.lang.Object pageOut(java.lang.Object key) throws CacheException
Cache
pageOut
in interface Cache
key
- the object's cache key
CacheException
public void remove(java.lang.Object object)
Cache
remove
in interface Cache
object
- the object's cache keypublic void destroy() throws CacheException
Cache
destroy
in interface Cache
CacheException
protected int getCapacity()
protected int getSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |