|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shiftone.cache.policy.AbstractPolicyCache org.shiftone.cache.policy.lfu.LfuCache
Class LfuCache
Field Summary |
Fields inherited from class org.shiftone.cache.policy.AbstractPolicyCache |
SHRINK_DIV |
Constructor Summary | |
(package private) |
LfuCache(java.lang.String name,
long timeoutMilliSeconds,
int maxSize)
|
|
LfuCache(java.lang.String name,
long timeoutMilliSeconds,
int maxSize,
EvictionListener evictionListener)
|
Method Summary | |
protected CacheNode |
createNode(java.lang.Object key,
java.lang.Object cacheObject)
Create a new node. |
protected void |
delete(CacheNode cacheNode)
Remove a node from the cache. |
(package private) java.lang.String |
dumpFifoKeys()
|
(package private) java.lang.String |
dumpLfuKeys()
|
protected CacheNode |
findNodeByKey(java.lang.Object key)
Method findNodeByKey |
protected CacheNode |
getLeastValuableNode()
This method will execute the cache's onEviction strategy. |
protected LinkedList |
getLowestNonEmptyLru()
|
protected LinkedList |
lru(int numUsageIndex)
|
void |
removeExpiredElements()
Method removeExpiredElements |
protected void |
revalueNode(CacheNode cacheNode)
Update the node's value. |
int |
size()
The number of key/value pares in the cache |
Methods inherited from class org.shiftone.cache.policy.AbstractPolicyCache |
addObject, clear, getMaxSize, getName, getObject, getTimeoutMilliSeconds, remove, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.shiftone.cache.Cache |
addObject, clear, getObject, remove |
Constructor Detail |
LfuCache(java.lang.String name, long timeoutMilliSeconds, int maxSize)
public LfuCache(java.lang.String name, long timeoutMilliSeconds, int maxSize, EvictionListener evictionListener)
Method Detail |
protected final LinkedList lru(int numUsageIndex)
public int size()
Cache
size
in interface Cache
protected CacheNode findNodeByKey(java.lang.Object key)
AbstractPolicyCache
findNodeByKey
in class AbstractPolicyCache
protected void revalueNode(CacheNode cacheNode)
AbstractPolicyCache
revalueNode
in class AbstractPolicyCache
protected void delete(CacheNode cacheNode)
AbstractPolicyCache
delete
in class AbstractPolicyCache
protected LinkedList getLowestNonEmptyLru()
protected CacheNode getLeastValuableNode()
AbstractPolicyCache
This method is only called by shrinkToSize();
getLeastValuableNode
in class AbstractPolicyCache
protected CacheNode createNode(java.lang.Object key, java.lang.Object cacheObject)
AbstractPolicyCache
createNode
in class AbstractPolicyCache
public void removeExpiredElements()
ReapableCache
removeExpiredElements
in interface ReapableCache
removeExpiredElements
in class AbstractPolicyCache
java.lang.String dumpLfuKeys()
java.lang.String dumpFifoKeys()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |