Package com.google.common.cache
Class LocalCache.WeightedWeakValueReference<K,V>
java.lang.Object
java.lang.ref.Reference<T>
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.intReturns the weight of this entry.Methods inherited from class com.google.common.cache.LocalCache.WeakValueReference
getEntry, isActive, isLoading, notifyNewValue, waitForValueMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersToMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.ValueReferenceReturns the weight of this entry. This is assumed to be static between calls to setValue.- Specified by:
getWeightin interfaceLocalCache.ValueReference<K,V> - Overrides:
getWeightin 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.ValueReferenceCreates a copy of this reference for the given entry.valuemay be null only for a loading reference.- Specified by:
copyForin interfaceLocalCache.ValueReference<K,V> - Overrides:
copyForin classLocalCache.WeakValueReference<K,V>
-