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()voidputIfAbsent(K key, V value) booleanvoidreplaceAll(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, valuesMethods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
SimpleLRUCache
-
-
Method Details
-
put
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V> - Overrides:
putIfAbsentin classConcurrentHashMap<K,V>
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
computeIfAbsentin interfaceMap<K,V> - Overrides:
computeIfAbsentin classConcurrentHashMap<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceConcurrentMap<K,V> - Specified by:
computeIfPresentin interfaceMap<K,V> - Overrides:
computeIfPresentin classConcurrentHashMap<K,V>
-
compute
-
merge
-
replace
-
replace
-
putAll
-
replaceAll
- Specified by:
replaceAllin interfaceConcurrentMap<K,V> - Specified by:
replaceAllin interfaceMap<K,V> - Overrides:
replaceAllin classConcurrentHashMap<K,V>
-
entrySet
-