Package org.springframework.util

# Class ConcurrentReferenceHashMap.Segment

java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.springframework.util.ConcurrentReferenceHashMap.Segment

All Implemented Interfaces:
  `Serializable`, `Lock`

Enclosing class:
  ConcurrentReferenceHashMap<K,V>

protected final class ConcurrentReferenceHashMap.Segment extends ReentrantLock
A single segment used to divide the map to allow better concurrent performance.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`Segment(int initialSize, int resizeThreshold)`

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Clear all items from this segment.
`int`
`getCount()`
Return the total number of references in this segment.
`ConcurrentReferenceHashMap.Reference<K,V>`
`getReference(Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure)`
`int`
`getSize()`
Return the size of the current references array.

### Methods inherited from class java.util.concurrent.locks.ReentrantLock

`getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Segment

public Segment(int initialSize, int resizeThreshold)

## Method Details

### getReference

@Nullable public ConcurrentReferenceHashMap.Reference<K,V> getReference(@Nullable Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure)

### clear

public void clear()
Clear all items from this segment.

### getSize

public int getSize()
Return the size of the current references array.

### getCount

public int getCount()
Return the total number of references in this segment.