static final class MapMakerInternalMap.WeakValueReference<K,V> extends java.lang.ref.WeakReference<V> implements MapMakerInternalMap.ValueReference<K,V>
Modifier and Type | Field and Description |
---|---|
(package private) MapMakerInternalMap.ReferenceEntry<K,V> |
entry |
Constructor and Description |
---|
WeakValueReference(java.lang.ref.ReferenceQueue<V> queue,
V referent,
MapMakerInternalMap.ReferenceEntry<K,V> entry) |
Modifier and Type | Method and Description |
---|---|
void |
clear(MapMakerInternalMap.ValueReference<K,V> newValue)
Clears this reference object.
|
MapMakerInternalMap.ValueReference<K,V> |
copyFor(java.lang.ref.ReferenceQueue<V> queue,
V value,
MapMakerInternalMap.ReferenceEntry<K,V> entry)
Creates a copy of this reference for the given entry.
|
MapMakerInternalMap.ReferenceEntry<K,V> |
getEntry()
Returns the entry associated with this value reference, or
null if this value
reference is independent of any entry. |
boolean |
isComputingReference()
Returns
true if the value type is a computing reference (regardless of whether or not
computation has completed). |
V |
waitForValue()
Waits for a value that may still be computing.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
final MapMakerInternalMap.ReferenceEntry<K,V> entry
WeakValueReference(java.lang.ref.ReferenceQueue<V> queue, V referent, MapMakerInternalMap.ReferenceEntry<K,V> entry)
public MapMakerInternalMap.ReferenceEntry<K,V> getEntry()
MapMakerInternalMap.ValueReference
null
if this value
reference is independent of any entry.getEntry
in interface MapMakerInternalMap.ValueReference<K,V>
public void clear(MapMakerInternalMap.ValueReference<K,V> newValue)
MapMakerInternalMap.ValueReference
clear
in interface MapMakerInternalMap.ValueReference<K,V>
newValue
- the new value reference which will replace this one; this is only used during
computation to immediately notify blocked threads of the new valuepublic MapMakerInternalMap.ValueReference<K,V> copyFor(java.lang.ref.ReferenceQueue<V> queue, V value, MapMakerInternalMap.ReferenceEntry<K,V> entry)
MapMakerInternalMap.ValueReference
value
may be null only for a loading reference.
copyFor
in interface MapMakerInternalMap.ValueReference<K,V>
public boolean isComputingReference()
MapMakerInternalMap.ValueReference
true
if the value type is a computing reference (regardless of whether or not
computation has completed). This is necessary to distiguish between partially-collected
entries and computing entries, which need to be cleaned up differently.isComputingReference
in interface MapMakerInternalMap.ValueReference<K,V>
public V waitForValue()
MapMakerInternalMap.ValueReference
waitForValue
in interface MapMakerInternalMap.ValueReference<K,V>