Top Description Methods
org.glassfish.hk2.utilities.cache

public Interface Computable<K, V>

Known Direct Implementers
org.glassfish.hk2.utilities.cache.LRUHybridCache, org.glassfish.hk2.utilities.cache.Cache

Utility interface to capture generic computation of type V from type K. Used in Cache.
Author
Jakub Podlesak (jakub.podlesak @ oracle.com)

Method Summary

Modifier and TypeMethod and Description
public V

Returns:

output from the computation.
compute
(K
input data.
key
)

Defines an expensive computation to retrieve value V from key K.

Method Detail

computeback to summary
public V compute(K key) throws ComputationErrorException

Defines an expensive computation to retrieve value V from key K.

Parameters
key:K

input data.

Returns:V

output from the computation.

Exceptions
ComputationErrorException:
if the computation performed should be returned by the cache but should not be kept in the cache associated with the key