Package com.google.common.cache
Class LocalCache.WeightedWeakValueReference<K,V>
java.lang.Object
java.lang.ref.Reference<V>
java.lang.ref.WeakReference<V>
com.google.common.cache.LocalCache.WeakValueReference<K,V>
com.google.common.cache.LocalCache.WeightedWeakValueReference<K,V>
- All Implemented Interfaces:
LocalCache.ValueReference<K,
V>
- Enclosing class:
LocalCache<K,
V>
static final class LocalCache.WeightedWeakValueReference<K,V>
extends LocalCache.WeakValueReference<K,V>
References a weak value.
-
Field Summary
FieldsFields inherited from class com.google.common.cache.LocalCache.WeakValueReference
entry
-
Constructor Summary
ConstructorsConstructorDescriptionWeightedWeakValueReference
(ReferenceQueue<V> queue, V referent, ReferenceEntry<K, V> entry, int weight) -
Method Summary
Modifier and TypeMethodDescriptioncopyFor
(ReferenceQueue<V> queue, V value, ReferenceEntry<K, V> entry) Creates a copy of this reference for the given entry.int
Returns the weight of this entry.Methods inherited from class com.google.common.cache.LocalCache.WeakValueReference
getEntry, isActive, isLoading, notifyNewValue, waitForValue
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.cache.LocalCache.ValueReference
get
-
Field Details
-
weight
final int weight
-
-
Constructor Details
-
WeightedWeakValueReference
WeightedWeakValueReference(ReferenceQueue<V> queue, V referent, ReferenceEntry<K, V> entry, int weight)
-
-
Method Details
-
getWeight
public int getWeight()Description copied from interface:LocalCache.ValueReference
Returns the weight of this entry. This is assumed to be static between calls to setValue.- Specified by:
getWeight
in interfaceLocalCache.ValueReference<K,
V> - Overrides:
getWeight
in classLocalCache.WeakValueReference<K,
V>
-
copyFor
public LocalCache.ValueReference<K,V> copyFor(ReferenceQueue<V> queue, V value, ReferenceEntry<K, V> entry) Description copied from interface:LocalCache.ValueReference
Creates a copy of this reference for the given entry.value
may be null only for a loading reference.- Specified by:
copyFor
in interfaceLocalCache.ValueReference<K,
V> - Overrides:
copyFor
in classLocalCache.WeakValueReference<K,
V>
-