static final class MapMakerInternalMap.StrongKeyWeakValueSegment<K,V> extends MapMakerInternalMap.Segment<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<K,V>,MapMakerInternalMap.StrongKeyWeakValueSegment<K,V>>
MapMakerInternalMap.Segment
for strong keys and weak values.Modifier and Type | Field and Description |
---|---|
private java.lang.ref.ReferenceQueue<V> |
queueForValues |
count, map, maxSegmentSize, modCount, readCount, table, threshold
Constructor and Description |
---|
StrongKeyWeakValueSegment(MapMakerInternalMap<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<K,V>,MapMakerInternalMap.StrongKeyWeakValueSegment<K,V>> map,
int initialCapacity,
int maxSegmentSize) |
Modifier and Type | Method and Description |
---|---|
MapMakerInternalMap.StrongKeyWeakValueEntry<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<V> |
getValueReferenceQueueForTesting()
Unsafely extracts the value reference queue used by this segment.
|
MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<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.StrongKeyWeakValueEntry<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.StrongKeyWeakValueSegment<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, getKeyReferenceQueueForTesting, 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, tryDrainReferenceQueues
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
private final java.lang.ref.ReferenceQueue<V> queueForValues
StrongKeyWeakValueSegment(MapMakerInternalMap<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<K,V>,MapMakerInternalMap.StrongKeyWeakValueSegment<K,V>> map, int initialCapacity, int maxSegmentSize)
map
- initialCapacity
- maxSegmentSize
- MapMakerInternalMap.StrongKeyWeakValueSegment<K,V> self()
MapMakerInternalMap.Segment
this
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.StrongKeyWeakValueEntry<K,V>,MapMakerInternalMap.StrongKeyWeakValueSegment<K,V>>
java.lang.ref.ReferenceQueue<V> getValueReferenceQueueForTesting()
MapMakerInternalMap.Segment
public MapMakerInternalMap.StrongKeyWeakValueEntry<K,V> castForTesting(MapMakerInternalMap.InternalEntry<K,V,?> entry)
MapMakerInternalMap.Segment
E
, 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.StrongKeyWeakValueEntry<K,V>,MapMakerInternalMap.StrongKeyWeakValueSegment<K,V>>
public MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<K,V>> getWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e)
MapMakerInternalMap.Segment
entry
.public MapMakerInternalMap.WeakValueReference<K,V,MapMakerInternalMap.StrongKeyWeakValueEntry<K,V>> newWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e, V value)
MapMakerInternalMap.Segment
MapMakerInternalMap.WeakValueReference
, referencing the given value
,
for the given entry
public void setWeakValueReferenceForTesting(MapMakerInternalMap.InternalEntry<K,V,?> e, MapMakerInternalMap.WeakValueReference<K,V,? extends MapMakerInternalMap.InternalEntry<K,V,?>> valueReference)
MapMakerInternalMap.Segment
entry
to be the given valueReference
void maybeDrainReferenceQueues()
MapMakerInternalMap.Segment
void maybeClearReferenceQueues()
MapMakerInternalMap.Segment