Class Weighers.EntryWeigherView<K,​V>

  • All Implemented Interfaces:
    EntryWeigher<K,​V>, java.io.Serializable
    Enclosing class:
    Weighers

    static final class Weighers.EntryWeigherView<K,​V>
    extends java.lang.Object
    implements EntryWeigher<K,​V>, java.io.Serializable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntryWeigherView

        EntryWeigherView​(Weigher<? super V> weigher)
    • Method Detail

      • weightOf

        public int weightOf​(K key,
                            V value)
        Description copied from interface: EntryWeigher
        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.
        Specified by:
        weightOf in interface EntryWeigher<K,​V>
        Parameters:
        key - the key to weigh
        value - the value to weigh
        Returns:
        the entry's weight