|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.slide.util.AbstractObjectCache
org.apache.slide.util.HashMapObjectCache
Object cache implementation using Keith Visco's HashMap structure.
| Field Summary | |
protected HashMap |
cache
Deprecated. Cache structure. |
| Fields inherited from class org.apache.slide.util.AbstractObjectCache |
cacheHits, cacheRequests, currentHitRatio, DEFAULT_HIT_RATIO, DEFAULT_SIZE, desiredHitRatio, initialSize, maxSize |
| Constructor Summary | |
HashMapObjectCache()
Deprecated. Constructor. |
|
HashMapObjectCache(int initialSize,
int maxSize,
double desiredHitRatio)
Deprecated. Constructor. |
|
| Method Summary | |
void |
clear()
Deprecated. Clear object cache. |
java.lang.Object |
get(java.lang.Object key)
Deprecated. Get the object associated with the key. |
protected int |
getSize()
Deprecated. Get cache size. |
void |
put(java.lang.Object key,
java.lang.Object value)
Deprecated. Add an object to the cache, or overwrite its value. |
void |
remove(java.lang.Object key)
Deprecated. Remove object associated with the given key. |
protected void |
removeSomeObjects()
Deprecated. Removes some elements from the cache. |
protected void |
resize()
Deprecated. Resize cache. |
| Methods inherited from class org.apache.slide.util.AbstractObjectCache |
shouldResize |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected HashMap cache
| Constructor Detail |
public HashMapObjectCache()
Warning (blinking) : That constructor is to be used really carefully as the cache maximum size is not limited.
public HashMapObjectCache(int initialSize,
int maxSize,
double desiredHitRatio)
initialSize - Initial size of the cachemaxSize - Maximum size of the cachedesiredHitRatio - Desired cache hit ratio| Method Detail |
public java.lang.Object get(java.lang.Object key)
get in interface ObjectCacheget in class AbstractObjectCachekey - Object's key
public void put(java.lang.Object key,
java.lang.Object value)
put in interface ObjectCacheput in class AbstractObjectCachekey - Object's keyvalue - Object's valuepublic void remove(java.lang.Object key)
remove in interface ObjectCacheremove in class AbstractObjectCachekey - Object's keypublic void clear()
clear in interface ObjectCacheclear in class AbstractObjectCacheprotected void removeSomeObjects()
removeSomeObjects in class AbstractObjectCacheprotected int getSize()
getSize in class AbstractObjectCacheprotected void resize()
resize in class AbstractObjectCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||