Interface Computable<K,V>
-
- All Known Implementing Classes:
Cache
,LRUHybridCache
public interface Computable<K,V>
Utility interface to capture generic computation of type V from type K. Used inCache
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
compute(K key)
Defines an expensive computation to retrieve value V from key K.
-
-
-
Method Detail
-
compute
V compute(K key) throws ComputationErrorException
Defines an expensive computation to retrieve value V from key K.- Parameters:
key
- input data.- Returns:
- output from the computation.
- Throws:
ComputationErrorException
- if the computation performed should be returned by the cache but should not be kept in the cache associated with the key
-
-