Class LazyHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
org.apache.felix.bundlerepository.impl.LazyHashMap<K,V>
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,
V>
A map that can delay the computation of certain values up until the moment that they
are actually needed. Useful for expensive to compute values such as the SHA-256.
This map does not support
null
values.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionLazyHashMap
(Collection<LazyHashMap.LazyValue<K, V>> lazyValues) This map behaves like a normal HashMap, expect for the entries passed in as lazy values. -
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
LazyHashMap
This map behaves like a normal HashMap, expect for the entries passed in as lazy values. A lazy value is a Callable object associated with a key. When the key is looked up and it's one of the lazy values, the value will be computed at that point and stored in the map. If the value is looked up again, it will be served from the map as usual.- Parameters:
lazyValues
-
-
-
Method Details