Package org.apache.camel.support.cache
Class SimpleLRUCache<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<K,V>
org.apache.camel.support.cache.SimpleLRUCache<K,V>
- Type Parameters:
K
- type of the keyV
- type of the value
- All Implemented Interfaces:
Serializable
,ConcurrentMap<K,
,V> Map<K,
V>
SimpleLRUCache
is a simple implementation of a cache of type Least Recently Used . The implementation doesn't
accept null values. Generally speaking, the parameters of all the public methods must have a value otherwise a
NullPointerException
is thrown.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,
V extends Object> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleLRUCache
(int initialCapacity, int maximumCacheSize, Consumer<V> evicted) -
Method Summary
Modifier and TypeMethodDescriptioncomputeIfAbsent
(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent
(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) entrySet()
void
putIfAbsent
(K key, V value) boolean
void
replaceAll
(BiFunction<? super K, ? super V, ? extends V> function) Methods inherited from class java.util.concurrent.ConcurrentHashMap
clear, contains, containsKey, containsValue, elements, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, newKeySet, newKeySet, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, search, searchEntries, searchKeys, searchValues, size, toString, values
Methods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
SimpleLRUCache
-
-
Method Details
-
put
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceConcurrentMap<K,
V> - Specified by:
putIfAbsent
in interfaceMap<K,
V> - Overrides:
putIfAbsent
in classConcurrentHashMap<K,
V>
-
computeIfAbsent
- Specified by:
computeIfAbsent
in interfaceConcurrentMap<K,
V> - Specified by:
computeIfAbsent
in interfaceMap<K,
V> - Overrides:
computeIfAbsent
in classConcurrentHashMap<K,
V>
-
computeIfPresent
- Specified by:
computeIfPresent
in interfaceConcurrentMap<K,
V> - Specified by:
computeIfPresent
in interfaceMap<K,
V> - Overrides:
computeIfPresent
in classConcurrentHashMap<K,
V>
-
compute
-
merge
-
replace
-
replace
-
putAll
-
replaceAll
- Specified by:
replaceAll
in interfaceConcurrentMap<K,
V> - Specified by:
replaceAll
in interfaceMap<K,
V> - Overrides:
replaceAll
in classConcurrentHashMap<K,
V>
-
entrySet
-