パッケージ org.springframework.util

クラス ConcurrentReferenceHashMap<K,V>

java.lang.ObjectSE
java.util.AbstractMapSE<K,V>
org.springframework.util.ConcurrentReferenceHashMap<K,V>
型パラメーター:
K - キー型
V - 値の型
実装されたすべてのインターフェース:
ConcurrentMapSE<K,V>MapSE<K,V>

public class ConcurrentReferenceHashMap<K,V> extends AbstractMapSE<K,V> implements ConcurrentMapSE<K,V>
soft または keys と values の両方に弱い参照を使用する ConcurrentHashMapSE

このクラスは、同時にアクセスしたときにパフォーマンスを向上させるために、Collections.synchronizedMap(new WeakHashMap<K, Reference<V>>()) の代替として使用できます。この実装は、null 値と null キーがサポートされていることを除いて、ConcurrentHashMapSE と同じ設計上の制約に従います。

注意 : 参照の使用は、マップに配置されたアイテムが後で利用可能になるという保証がないことを意味します。ガベージコレクターはいつでも参照を破棄する可能性があるため、不明なスレッドが静かにエントリを削除しているように見えることがあります。

明示的に指定されていない場合、この実装はソフトエントリ参照SEを使用します。

導入:
3.2
作成者:
Phillip Webb, Juergen Hoeller, Brian Clozel
  • コンストラクターの詳細

    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap()
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity, float loadFactor)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
      loadFactor - 負荷率。テーブルごとの平均参照数がこの値を超えると、サイズ変更が試行されます
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity, int concurrencyLevel)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
      concurrencyLevel - 同時にマップに書き込むスレッドの予想数
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity, ConcurrentReferenceHashMap.ReferenceType referenceType)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
      referenceType - エントリに使用される参照型 (柔らかいか弱い)
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity, float loadFactor, int concurrencyLevel)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
      loadFactor - 負荷率。テーブルごとの平均参照数がこの値を超えると、サイズ変更が試行されます。
      concurrencyLevel - 同時にマップに書き込むスレッドの予想数
    • ConcurrentReferenceHashMap

      public ConcurrentReferenceHashMap(int initialCapacity, float loadFactor, int concurrencyLevel, ConcurrentReferenceHashMap.ReferenceType referenceType)
      新しい ConcurrentReferenceHashMap インスタンスを作成します。
      パラメーター:
      initialCapacity - マップの初期容量
      loadFactor - 負荷率。テーブルごとの平均参照数がこの値を超えると、サイズ変更が試行されます。
      concurrencyLevel - 同時にマップに書き込むスレッドの予想数
      referenceType - エントリに使用される参照型 (柔らかいか弱い)
  • メソッドの詳細