K
- the cache key entry typeV
- the cache key value typeprotected class JexlEngine.SoftCache<K,V>
extends java.lang.Object
The cache is held through a soft reference, allowing it to be GCed under memory pressure.
Modifier and Type | Field and Description |
---|---|
private java.lang.ref.SoftReference<java.util.Map<K,V>> |
ref
The soft reference to the cache map.
|
private int |
size
The cache size.
|
Constructor and Description |
---|
SoftCache(int theSize)
Creates a new instance of a soft cache.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
clear()
Clears the cache.
|
(package private) java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Produces the cache entry set.
|
(package private) V |
get(K key)
Gets a value from cache.
|
(package private) void |
put(K key,
V script)
Puts a value in cache.
|
(package private) int |
size()
Returns the cache size.
|
SoftCache(int theSize)
theSize
- the cache sizeint size()
void clear()
java.util.Set<java.util.Map.Entry<K,V>> entrySet()
V get(K key)
key
- the cache entry key