类 ConcurrentReferenceHashMap.Segment

    • 构造器详细资料

      • Segment

        public Segment​(int initialCapacity)
    • 方法详细资料

      • doTask

        public <T> T doTask​(int hash,
                            Object key,
                            org.springframework.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 key
        key - the key
        task - the update operation
        返回:
        the result of the operation
      • clear

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

        protected final void restructureIfNecessary​(boolean allowResize)
        Restructure the underlying data structure when it becomes necessary. This method can increase the size of the references table as well as purge any references that have been garbage collected.
        参数:
        allowResize - if resizing is permitted
      • 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.