[Java] Interface EntryWeigher<K, V>
A class that can determine the weight of an entry. The total weight threshold is used to determine when an eviction is required.
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
int |
weightOf(K key, V value) Measures an entry's weight to determine how many units of capacity that the key and value consumes. |
Method Detail
public int weightOf(K key, V value)
Measures an entry's weight to determine how many units of capacity that the key and value consumes. An entry must consume a minimum of one unit.
- Parameters:
-
key
- the key to weigh -
value
- the value to weigh
- Returns:
- the entry's weight
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.5.14/html/gapi/org/apache/groovy/util/concurrentlinkedhashmap/EntryWeigher.html