Class ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V>
- java.lang.Object
-
- com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V>
-
- All Implemented Interfaces:
EntryWeigher<K,V>
,java.io.Serializable
- Enclosing class:
- ConcurrentLinkedHashMap<K,V>
static final class ConcurrentLinkedHashMap.BoundedEntryWeigher<K,V> extends java.lang.Object implements EntryWeigher<K,V>, java.io.Serializable
A weigher that enforces that the weight falls within a valid range.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static long
serialVersionUID
(package private) EntryWeigher<? super K,? super V>
weigher
-
Constructor Summary
Constructors Constructor Description BoundedEntryWeigher(EntryWeigher<? super K,? super V> weigher)
-
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.(package private) java.lang.Object
writeReplace()
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
weigher
final EntryWeigher<? super K,? super V> weigher
-
-
Constructor Detail
-
BoundedEntryWeigher
BoundedEntryWeigher(EntryWeigher<? super K,? 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 interfaceEntryWeigher<K,V>
- Parameters:
key
- the key to weighvalue
- the value to weigh- Returns:
- the entry's weight
-
writeReplace
java.lang.Object writeReplace()
-
-