|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jcreme.caches.BaseCache
org.jcreme.caches.HashCache
org.jcreme.caches.FIFOCache
The FIFO cache is based on a First In First Out algorithm to select the objects that are removed from the cache to make room. This implementation uses a LinkedList.
| Constructor Summary | |
FIFOCache()
Creates new LIFOCache |
|
FIFOCache(int minSize,
int maxSize)
Creates new LIFOCache |
|
| Method Summary | |
void |
clear()
Removes all the objects from the Cache, leaving it empty. |
void |
registerObject(java.lang.Object key,
java.lang.Object value)
This method adds an object in the cache. |
protected void |
removeOneElement()
This method is called when room is needed to add a new object in the cache. |
void |
unregisterObject(java.lang.Object key)
This method removes an object from the cache. |
| Methods inherited from class org.jcreme.caches.HashCache |
getAllObjects, getAllObjects, getMap, getObject, getSize, registerAllObjects |
| Methods inherited from class org.jcreme.caches.BaseCache |
addCacheListener, buildEvent, fireElementAdded, fireElementRemoved, getCacheListeners, getMaxSize, getMinSize, getReplacementPolicy, removeCacheListener, setMaxSize, setReplacementPolicy |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FIFOCache()
public FIFOCache(int minSize,
int maxSize)
minSize - the initial size of the Cache.maxSize - the maximum number of objects contained by the cache.| Method Detail |
public void registerObject(java.lang.Object key,
java.lang.Object value)
throws CacheFullException
registerObject in interface CacheregisterObject in class HashCachekey - the key that will be used to retrieve the object.value - the object to store in the cache.
CacheFullException - if the object could not be stored in the cache.public void unregisterObject(java.lang.Object key)
unregisterObject in interface CacheunregisterObject in class HashCachekey - the key that was used to store the object in the cache.public void clear()
clear in interface Cacheclear in class HashCacheprotected void removeOneElement()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||