Class BoundedWeigher<K,​V>

  • All Implemented Interfaces:
    Weigher<K,​V>, java.io.Serializable

    final class BoundedWeigher<K,​V>
    extends java.lang.Object
    implements Weigher<K,​V>, java.io.Serializable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Weigher<? super K,​? super V> delegate  
      (package private) static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedWeigher​(Weigher<? super K,​? super V> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int weigh​(K key, V value)
      Returns the weight of a cache entry.
      (package private) java.lang.Object writeReplace()  
      • Methods inherited from class java.lang.Object

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

      • BoundedWeigher

        BoundedWeigher​(Weigher<? super K,​? super V> delegate)
    • Method Detail

      • weigh

        public int weigh​(K key,
                         V value)
        Description copied from interface: Weigher
        Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply relative to each other.
        Specified by:
        weigh in interface Weigher<K,​V>
        Parameters:
        key - the key to weigh
        value - the value to weigh
        Returns:
        the weight of the entry; must be non-negative
      • writeReplace

        java.lang.Object writeReplace()