Interface Weigher<V>
- All Known Implementing Classes:
Weighers.ByteArrayWeigher
,Weighers.CollectionWeigher
,Weighers.IterableWeigher
,Weighers.ListWeigher
,Weighers.MapWeigher
,Weighers.SetWeigher
,Weighers.SingletonWeigher
@ThreadSafe
public interface Weigher<V>
A class that can determine the weight of a value. The total weight threshold
is used to determine when an eviction is required.
- See Also:
-
Method Summary
-
Method Details
-
weightOf
Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit.- Parameters:
value
- the object to weigh- Returns:
- the object's weight
-