-
public interface DDPartialKeyCache<K, V>Cache that can work on parts of a key to look up a value.
An example would be looking up values from a substring of a string instead of first creating a string to do the lookup.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDDPartialKeyCache.Hasherpublic interfaceDDPartialKeyCache.Comparatorpublic interfaceDDPartialKeyCache.Producer
-
Method Summary
Modifier and Type Method Description abstract VcomputeIfAbsent(K key, int m, int n, DDPartialKeyCache.Hasher<K> hasher, DDPartialKeyCache.Comparator<K, V> comparator, DDPartialKeyCache.Producer<K, out V> producer)Look up or create and store a value in the cache. abstract voidclear()Clear the cache. -
-
Method Detail
-
computeIfAbsent
abstract V computeIfAbsent(K key, int m, int n, DDPartialKeyCache.Hasher<K> hasher, DDPartialKeyCache.Comparator<K, V> comparator, DDPartialKeyCache.Producer<K, out V> producer)
Look up or create and store a value in the cache.
- Parameters:
key- the key to look upm- extra parameter that is passed along with the keyn- extra parameter that is passed along with the keyhasher- how to compute the hash using key, m, and ncomparator- how to compare the key, m, n, and valueproducer- how to create a cached value base on the key, m, and n if the lookup fails
-
clear
abstract void clear()
Clear the cache.
-
-
-
-