Package com.google.common.cache
Class LocalCache.WeightedSoftValueReference<K,V>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- 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
Fields Modifier and Type Field Description (package private) int
weight
-
Fields inherited from class com.google.common.cache.LocalCache.SoftValueReference
entry
-
-
Constructor Summary
Constructors Constructor Description WeightedSoftValueReference(java.lang.ref.ReferenceQueue<V> queue, V referent, ReferenceEntry<K,V> entry, int weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalCache.ValueReference<K,V>
copyFor(java.lang.ref.ReferenceQueue<V> queue, V value, ReferenceEntry<K,V> entry)
Creates a copy of this reference for the given entry.int
getWeight()
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.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence
-
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
-
-
-
-
Constructor Detail
-
WeightedSoftValueReference
WeightedSoftValueReference(java.lang.ref.ReferenceQueue<V> queue, V referent, ReferenceEntry<K,V> entry, int weight)
-
-
Method Detail
-
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(java.lang.ref.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>
-
-