Key
- The type for the cache key entriesValue
- The type for the cache value entriespublic class OgnlLRUCache<Key,Value> extends Object implements OgnlCache<Key,Value>
Collections.synchronizedMap(java.util.Map)
backed by a LinkedHashMap
. May be replaced by a more efficient implementation in the future.
Setting too low an eviction limit will produce more overhead than value.
Setting too high an eviction limit may also produce more overhead than value.
An appropriate eviction limit will need to be determined on an individual application basis.Constructor and Description |
---|
OgnlLRUCache(int evictionLimit,
int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Value |
get(Key key) |
int |
getEvictionLimit() |
void |
put(Key key,
Value value) |
void |
putIfAbsent(Key key,
Value value) |
void |
setEvictionLimit(int cacheEvictionLimit) |
int |
size() |
public OgnlLRUCache(int evictionLimit, int initialCapacity, float loadFactor)
public void putIfAbsent(Key key, Value value)
putIfAbsent
in interface OgnlCache<Key,Value>
public int getEvictionLimit()
getEvictionLimit
in interface OgnlCache<Key,Value>
public void setEvictionLimit(int cacheEvictionLimit)
setEvictionLimit
in interface OgnlCache<Key,Value>
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.