Interface Weigher<V>

Type Parameters:
V - 值类型 ben.manes@gmail.com (Ben Manes)

public interface Weigher<V>
A class that can determine the selector of a value. The total selector threshold is used to determine when an eviction is required.
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    weightOf(V value)
    Measures an object's selector to determine how many units of capacity that the value consumes.
  • Method Details

    • weightOf

      int weightOf(V value)
      Measures an object's selector 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 selector