static final class MapMakerInternalMap.WeakKeyWeakValueSegment<K,V> extends MapMakerInternalMap.Segment<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>,MapMakerInternalMap.WeakKeyWeakValueSegment<K,V>>
MapMakerInternalMap.Segment for weak keys and weak values.| Modifier and Type | Field and Description |
|---|---|
private java.lang.ref.ReferenceQueue<K> |
queueForKeys |
private java.lang.ref.ReferenceQueue<V> |
queueForValues |
count, map, maxSegmentSize, modCount, readCount, table, threshold| Constructor and Description |
|---|
WeakKeyWeakValueSegment(MapMakerInternalMap<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>,MapMakerInternalMap.WeakKeyWeakValueSegment<K,V>> map,
int initialCapacity,
int maxSegmentSize) |
| Modifier and Type | Method and Description |
|---|---|
MapMakerInternalMap.WeakKeyWeakValueEntry<K,V> |
castForTesting(MapMakerInternalMap.InternalEntry<K,V,?> entry)
Unsafe cast of the given entry to
E, the type of the specific MapMakerInternalMap.InternalEntry
implementation type. |
(package private) java.lang.ref.ReferenceQueue<K> |
getKeyReferenceQueueForTesting()
Unsafely extracts the key reference queue used by this segment.
|
(package private) java.lang.ref.ReferenceQueue<V> |
getValueReferenceQueueForTesting()
Unsafely extracts the value reference queue used by this segment.
|
MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>> |
getWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e)
Unsafely extracts the weak value reference inside of the given
entry. |
(package private) void |
maybeClearReferenceQueues()
Clears the reference queues used by this segment, if any.
|
(package private) void |
maybeDrainReferenceQueues()
Drains the reference queues used by this segment, if any.
|
MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>> |
newWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e,
V value)
Unsafely creates of a fresh
MapMakerInternalMap.WeakValueReference, referencing the given value,
for the given entry |
(package private) MapMakerInternalMap.WeakKeyWeakValueSegment<K,V> |
self()
|
void |
setWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e,
MapMakerInternalMap.WeakValueReference<K,V,? extends MapMakerInternalMap.InternalEntry<K,V,?>> valueReference)
Unsafely sets the weak value reference inside the given
entry to be the given valueReference |
clear, clearReferenceQueue, clearValueForTesting, containsKey, containsValue, copyEntry, copyForTesting, drainKeyReferenceQueue, drainValueReferenceQueue, expand, get, getEntry, getFirst, getLiveEntry, getLiveValue, getLiveValueForTesting, initTable, isCollected, newEntryArray, newEntryForTesting, postReadCleanup, preWriteCleanup, put, reclaimKey, reclaimValue, remove, remove, removeEntryForTesting, removeFromChain, removeFromChainForTesting, removeTableEntryForTesting, replace, replace, runCleanup, runLockedCleanup, setTableEntryForTesting, setValue, setValueForTesting, tryDrainReferenceQueuesgetHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlockprivate final java.lang.ref.ReferenceQueue<K> queueForKeys
private final java.lang.ref.ReferenceQueue<V> queueForValues
WeakKeyWeakValueSegment(MapMakerInternalMap<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>,MapMakerInternalMap.WeakKeyWeakValueSegment<K,V>> map, int initialCapacity, int maxSegmentSize)
MapMakerInternalMap.WeakKeyWeakValueSegment<K,V> self()
MapMakerInternalMap.Segmentthis up-casted to the specific MapMakerInternalMap.Segment implementation type S.
This method exists so that the MapMakerInternalMap.Segment code can be generic in terms of S,
the type of the concrete implementation.
self in class MapMakerInternalMap.Segment<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>,MapMakerInternalMap.WeakKeyWeakValueSegment<K,V>>java.lang.ref.ReferenceQueue<K> getKeyReferenceQueueForTesting()
MapMakerInternalMap.Segmentjava.lang.ref.ReferenceQueue<V> getValueReferenceQueueForTesting()
MapMakerInternalMap.Segmentpublic MapMakerInternalMap.WeakKeyWeakValueEntry<K,V> castForTesting(MapMakerInternalMap.InternalEntry<K,V,?> entry)
MapMakerInternalMap.SegmentE, the type of the specific MapMakerInternalMap.InternalEntry
implementation type.
This method is provided as a convenience for tests. Otherwise they'd need to be knowledgable about all the implementation details of our type system trickery.
castForTesting in class MapMakerInternalMap.Segment<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>,MapMakerInternalMap.WeakKeyWeakValueSegment<K,V>>public MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>> getWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e)
MapMakerInternalMap.Segmententry.public MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.WeakKeyWeakValueEntry<K,V>> newWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e, V value)
MapMakerInternalMap.SegmentMapMakerInternalMap.WeakValueReference, referencing the given value,
for the given entrypublic void setWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e, MapMakerInternalMap.WeakValueReference<K,V,? extends MapMakerInternalMap.InternalEntry<K,V,?>> valueReference)
MapMakerInternalMap.Segmententry to be the given valueReferencevoid maybeDrainReferenceQueues()
MapMakerInternalMap.Segmentvoid maybeClearReferenceQueues()
MapMakerInternalMap.Segment