Package com.google.common.cache
Class LocalCache.WeightedSoftValueReference<K,V>
java.lang.Object
java.lang.ref.Reference<V>
java.lang.ref.SoftReference<V>
com.google.common.cache.LocalCache.SoftValueReference<K,V>
com.google.common.cache.LocalCache.WeightedSoftValueReference<K,V>
- All Implemented Interfaces:
LocalCache.ValueReference<K,V>
- Enclosing class:
LocalCache<K,V>
static final class LocalCache.WeightedSoftValueReference<K,V>
extends LocalCache.SoftValueReference<K,V>
References a soft value.
-
Field Summary
FieldsFields inherited from class com.google.common.cache.LocalCache.SoftValueReference
entry -
Constructor Summary
ConstructorsConstructorDescriptionWeightedSoftValueReference(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.SoftValueReference
getEntry, isActive, isLoading, notifyNewValue, waitForValueMethods inherited from class java.lang.ref.SoftReference
getMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, 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
-
WeightedSoftValueReference
WeightedSoftValueReference(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.SoftValueReference<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.SoftValueReference<K,V>
-