static final class ConcurrentWeakKeyHashMap.Segment<K,V>
extends java.util.concurrent.locks.ReentrantLock
Modifier and Type | Field and Description |
---|---|
(package private) int |
count
The number of elements in this segment's region.
|
(package private) float |
loadFactor
The load factor for the hash table.
|
(package private) int |
modCount
Number of updates that alter the size of the table.
|
(package private) java.lang.ref.ReferenceQueue<java.lang.Object> |
refQueue
The collected weak-key reference queue for this segment.
|
private static long |
serialVersionUID |
(package private) ConcurrentWeakKeyHashMap.HashEntry<K,V>[] |
table
The per-segment table.
|
(package private) int |
threshold
The table is rehashed when its size exceeds this threshold.
|
Constructor and Description |
---|
ConcurrentWeakKeyHashMap.Segment(int initialCapacity,
float lf) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
clear() |
(package private) boolean |
containsKey(java.lang.Object key,
int hash) |
(package private) boolean |
containsValue(java.lang.Object value) |
(package private) V |
get(java.lang.Object key,
int hash) |
(package private) ConcurrentWeakKeyHashMap.HashEntry<K,V> |
getFirst(int hash)
Returns properly casted first entry of bin for given hash.
|
private boolean |
keyEq(java.lang.Object src,
java.lang.Object dest) |
(package private) static <K,V> ConcurrentWeakKeyHashMap.Segment<K,V>[] |
newArray(int i) |
(package private) ConcurrentWeakKeyHashMap.HashEntry<K,V> |
newHashEntry(K key,
int hash,
ConcurrentWeakKeyHashMap.HashEntry<K,V> next,
V value) |
(package private) V |
put(K key,
int hash,
V value,
boolean onlyIfAbsent) |
(package private) V |
readValueUnderLock(ConcurrentWeakKeyHashMap.HashEntry<K,V> e)
Reads value field of an entry under lock.
|
(package private) int |
rehash() |
(package private) V |
remove(java.lang.Object key,
int hash,
java.lang.Object value,
boolean refRemove)
Remove; match on key only if value null, else match both.
|
(package private) void |
removeStale() |
(package private) V |
replace(K key,
int hash,
V newValue) |
(package private) boolean |
replace(K key,
int hash,
V oldValue,
V newValue) |
(package private) void |
setTable(ConcurrentWeakKeyHashMap.HashEntry<K,V>[] newTable)
Sets table to new HashEntry array.
|
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
private static final long serialVersionUID
transient volatile int count
int modCount
int threshold
transient volatile ConcurrentWeakKeyHashMap.HashEntry<K,V>[] table
final float loadFactor
transient volatile java.lang.ref.ReferenceQueue<java.lang.Object> refQueue
ConcurrentWeakKeyHashMap.Segment(int initialCapacity, float lf)
static <K,V> ConcurrentWeakKeyHashMap.Segment<K,V>[] newArray(int i)
private boolean keyEq(java.lang.Object src, java.lang.Object dest)
void setTable(ConcurrentWeakKeyHashMap.HashEntry<K,V>[] newTable)
ConcurrentWeakKeyHashMap.HashEntry<K,V> getFirst(int hash)
ConcurrentWeakKeyHashMap.HashEntry<K,V> newHashEntry(K key, int hash, ConcurrentWeakKeyHashMap.HashEntry<K,V> next, V value)
V readValueUnderLock(ConcurrentWeakKeyHashMap.HashEntry<K,V> e)
V get(java.lang.Object key, int hash)
boolean containsKey(java.lang.Object key, int hash)
boolean containsValue(java.lang.Object value)
int rehash()
V remove(java.lang.Object key, int hash, java.lang.Object value, boolean refRemove)
final void removeStale()
void clear()