Top Description Methods
com.google.common.cache

public Interface Weigher<K, V>

Known Direct Implementers
com.google.common.cache.CacheBuilder.OneWeigher
Annotations
@GwtCompatible
@FunctionalInterface
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible

Calculates the weights of cache entries.
Author
Charles Fry
Since
11.0

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the weight of the entry; must be non-negative
weigh
(K key, V value)

Returns the weight of a cache entry.

Method Detail

weighback to summary
public int weigh(K key, V value)

Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply relative to each other.

Returns:int

the weight of the entry; must be non-negative