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.
    • 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