类 ConcurrentReferenceHashMap.Segment
java.lang.Object
java.util.concurrent.locks.ReentrantLock
cn.taketoday.util.ConcurrentReferenceHashMap.Segment
- 所有已实现的接口:
Serializable,Lock
- 封闭类:
- ConcurrentReferenceHashMap<K,
V>
A single segment used to divide the map to allow better concurrent performance.
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()Clear all items from this segment.<T> TdoTask(int hash, Object key, ConcurrentReferenceHashMap<K, V>.cn.taketoday.util.ConcurrentReferenceHashMap.Task<T> task) Apply an update operation to this segment.final intgetCount()Return the total number of references in this segment.getReference(Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure) final intgetSize()Return the size of the current references array.从类继承的方法 java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
构造器详细资料
-
Segment
public Segment(int initialSize, int resizeThreshold)
-
-
方法详细资料
-
getReference
@Nullable public ConcurrentReferenceHashMap.Reference<K,V> getReference(@Nullable Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure) -
doTask
@Nullable public <T> T doTask(int hash, @Nullable Object key, ConcurrentReferenceHashMap<K, V>.cn.taketoday.util.ConcurrentReferenceHashMap.Task<T> task) Apply an update operation to this segment. The segment will be locked during the update.- 参数:
hash- the hash of the keykey- the keytask- the update operation- 返回:
- the result of the operation
-
clear
public void clear()Clear all items from this segment. -
getSize
public final int getSize()Return the size of the current references array. -
getCount
public final int getCount()Return the total number of references in this segment.
-