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.int
Returns the weight of this entry.Methods inherited from class com.google.common.cache.LocalCache.SoftValueReference
getEntry, isActive, isLoading, notifyNewValue, waitForValue
Methods inherited from class java.lang.ref.SoftReference
get
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, 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
-
WeightedSoftValueReference
WeightedSoftValueReference(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.SoftValueReference<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.SoftValueReference<K,
V>
-