Interface EntryWeigher<K,V>
- Type Parameters:
K- 键类型V- 值类型
public interface EntryWeigher<K,V>
A class that can determine the selector of an entry. The total selector threshold is used to determine when an
eviction is required.
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Method Summary
-
Method Details
-
weightOf
Measures an entry's selector to determine how many units of capacity that the data and value consumes. An entry must consume a minimum of one unit.- Parameters:
key- the data to weighvalue- the value to weigh- Returns:
- the entry's selector
-