public abstract class Memoizer<K,V> extends Object
Conceptually a function from K -> V that computes values lazily and remembers the results. Often used to implement a data store per key.
Constructor and Description |
---|
Memoizer() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the computed values.
|
abstract V |
compute(K key)
Creates a new instance.
|
V |
get(K key) |
Iterable<V> |
values()
Provides a snapshot view of all
V s. |
Copyright © 2014. All rights reserved.