K - key typeV - value typepublic class Memoizer<K,V> extends Object
| Modifier and Type | Field and Description |
|---|---|
static Object |
NULL_OBJECT
Null object to be kept as values which are
null |
| Constructor and Description |
|---|
Memoizer(ConstructorFunction<K,V> calculationFunction)
Constructs the memoizer.
|
| Modifier and Type | Method and Description |
|---|---|
V |
getOrCalculate(K key)
Returns the value for the
key, calculating it in the process if
necessary. |
void |
remove(K key)
Removes the entry associated with the given
key |
public static final Object NULL_OBJECT
nullpublic Memoizer(ConstructorFunction<K,V> calculationFunction)
calculationFunction - the function for retrieving the value for a specific keyCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.