Class ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V>

java.lang.Object
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V>
All Implemented Interfaces:
EntryWeigher<K,V>, Serializable
Enclosing class:
ConcurrentLinkedHashMap<K,V>

static final class ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V> extends Object implements EntryWeigher<K,V>, Serializable
A weigher that enforces that the weight falls within a valid range.
  • Field Details

  • Constructor Details

    • BoundedEntryWeigher

      BoundedEntryWeigher(EntryWeigher<? super K,? super V> weigher)
  • Method Details

    • 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
    • writeReplace

      Object writeReplace()