private static final class ComputingConcurrentHashMap.ComputationExceptionReference<K,V> extends java.lang.Object implements MapMakerInternalMap.ValueReference<K,V>
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.Throwable |
t |
| Constructor and Description |
|---|
ComputationExceptionReference(java.lang.Throwable t) |
| 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.
|
V |
get()
Gets the value.
|
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.
|
ComputationExceptionReference(java.lang.Throwable t)
public V get()
MapMakerInternalMap.ValueReferenceget in interface MapMakerInternalMap.ValueReference<K,V>public MapMakerInternalMap.ReferenceEntry<K,V> getEntry()
MapMakerInternalMap.ValueReferencenull if this value
reference is independent of any entry.getEntry in interface MapMakerInternalMap.ValueReference<K,V>public MapMakerInternalMap.ValueReference<K,V> copyFor(java.lang.ref.ReferenceQueue<V> queue, V value, MapMakerInternalMap.ReferenceEntry<K,V> entry)
MapMakerInternalMap.ValueReferencevalue may be null only for a loading reference.
copyFor in interface MapMakerInternalMap.ValueReference<K,V>public boolean isComputingReference()
MapMakerInternalMap.ValueReferencetrue 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() throws java.util.concurrent.ExecutionException
MapMakerInternalMap.ValueReferencewaitForValue in interface MapMakerInternalMap.ValueReference<K,V>java.util.concurrent.ExecutionException - if the computing thread throws an exceptionpublic void clear(MapMakerInternalMap.ValueReference<K,V> newValue)
MapMakerInternalMap.ValueReferenceclear 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 value