|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl3.internal.SoftCache<K,V>
K - the cache key entry typeV - the cache key value typepublic class SoftCache<K,V>
A soft referenced cache.
The actual cache is held through a soft reference, allowing it to be GCed under memory pressure.
| Method Summary | ||
|---|---|---|
void |
clear()
Clears the cache. |
|
|
createCache(int cacheSize)
Creates the cache store. |
|
List<Map.Entry<K,V>> |
entries()
Produces the cache entry set. |
|
V |
get(K key)
Gets a value from cache. |
|
void |
put(K key,
V script)
Puts a value in cache. |
|
int |
size()
Returns the cache size. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int size()
public void clear()
public V get(K key)
key - the cache entry key
public void put(K key,
V script)
key - the cache entry keyscript - the cache entry valuepublic List<Map.Entry<K,V>> entries()
For testing only, perform deep copy of cache entries
public <K,V> Map<K,V> createCache(int cacheSize)
K - the key typeV - the value typecacheSize - the cache size, must be > 0
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||