Module org.glassfish.hk2.utilities
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 in
Cache.- Author:
- Jakub Podlesak (jakub.podlesak @ oracle.com)
-
Method Summary
-
Method Details
-
compute
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
-