Interface Weigher<K,​V>

    • Method Detail

      • weigh

        int weigh​(K key,
                  V value)
        Returns a weight for the given cached value. This will be called after a value is inserted or updated.

        The cache implementations may derive an approximate value which has less precision. The total weight in the statistics represents an approximation as well.

        a positive value representing the relative weight in comparison to the other entries in the cache.