org.apache.commons.collections
クラス SoftRefHashMap

java.lang.Object
  |
  +--org.apache.commons.collections.SoftRefHashMap
すべての実装インタフェース:
java.util.Map

public class SoftRefHashMap
extends java.lang.Object
implements java.util.Map

HashMap with SoftReference links to values which allows the values of the Map to be garbage collected by the JVM if it becomes low on memory. Derive from this class and override the factory method createReference() method to make a Map wrapped in other types of Reference.

A synchronized version can be obtained with: Collections.synchronizedMap( theMapToSynchronize )

WARNING the values() and entrySet() methods require optimisation like the standard HashMap implementations so that iteration over this Map is efficient.

作成者:
James.Dodd, James Strachan

クラス java.util.Map から継承した内部クラス
java.util.Map.Entry
 
コンストラクタの概要
SoftRefHashMap()
           
 
メソッドの概要
 void clear()
          Clears all mappings
 boolean containsKey(java.lang.Object key)
          Answers whether the argument is in the domain of the mappings
 boolean containsValue(java.lang.Object value)
          Answers whether the argument is a Referenced value
 java.util.Set entrySet()
          Returns a set view of the mappings in the wrapped map
 boolean equals(java.lang.Object object)
          Answers whether this map and the argument are 'the same'
 java.lang.Object get(java.lang.Object key)
          Retrieves the referent of the Referenced value
 int hashCode()
          Calculates the hash code for this map
 boolean isEmpty()
          Answers whether there are any mappings
 java.util.Set keySet()
          Returns the domain of the mappings
 void purge()
          Removes References that have had their referents garbage collected
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Adds a key-value mapping, wrapping the value in a Reference
 void putAll(java.util.Map map)
          Put all of the mappings in the argument into this wrapped map
 java.lang.Object remove(java.lang.Object key)
          Removes a mapping from this map
 int size()
          Returns the number of mappings in this map
 java.util.Collection values()
          Returns a collection of the Referenced values
 
クラス java.lang.Object から継承したメソッド
getClass, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

SoftRefHashMap

public SoftRefHashMap()
メソッドの詳細

clear

public void clear()
Clears all mappings
定義:
インタフェース java.util.Map 内の clear

containsKey

public boolean containsKey(java.lang.Object key)
Answers whether the argument is in the domain of the mappings
定義:
インタフェース java.util.Map 内の containsKey

containsValue

public boolean containsValue(java.lang.Object value)
Answers whether the argument is a Referenced value
定義:
インタフェース java.util.Map 内の containsValue

entrySet

public java.util.Set entrySet()
Returns a set view of the mappings in the wrapped map
定義:
インタフェース java.util.Map 内の entrySet

equals

public boolean equals(java.lang.Object object)
Answers whether this map and the argument are 'the same'
定義:
インタフェース java.util.Map 内の equals
オーバーライド:
クラス java.lang.Object 内の equals

get

public java.lang.Object get(java.lang.Object key)
Retrieves the referent of the Referenced value
定義:
インタフェース java.util.Map 内の get
パラメータ:
key - The key with which to retrieve the value

hashCode

public int hashCode()
Calculates the hash code for this map
定義:
インタフェース java.util.Map 内の hashCode
オーバーライド:
クラス java.lang.Object 内の hashCode

isEmpty

public boolean isEmpty()
Answers whether there are any mappings
定義:
インタフェース java.util.Map 内の isEmpty

keySet

public java.util.Set keySet()
Returns the domain of the mappings
定義:
インタフェース java.util.Map 内の keySet

purge

public void purge()
Removes References that have had their referents garbage collected

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Adds a key-value mapping, wrapping the value in a Reference
定義:
インタフェース java.util.Map 内の put

putAll

public void putAll(java.util.Map map)
Put all of the mappings in the argument into this wrapped map
定義:
インタフェース java.util.Map 内の putAll

remove

public java.lang.Object remove(java.lang.Object key)
Removes a mapping from this map
定義:
インタフェース java.util.Map 内の remove

size

public int size()
Returns the number of mappings in this map
定義:
インタフェース java.util.Map 内の size

values

public java.util.Collection values()
Returns a collection of the Referenced values
定義:
インタフェース java.util.Map 内の values


Copyright © 2001 Apache Software Foundation. Documenation generated November 5 2001.