|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.collections.SoftRefHashMap
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.
Constructor Summary | |
SoftRefHashMap()
Deprecated. |
Method Summary | |
void |
clear()
Deprecated. Clears all mappings |
boolean |
containsKey(java.lang.Object key)
Deprecated. Answers whether the argument is in the domain of the mappings |
boolean |
containsValue(java.lang.Object value)
Deprecated. Answers whether the argument is a Referenced value |
java.util.Set |
entrySet()
Deprecated. Returns a set view of the mappings in the wrapped map |
boolean |
equals(java.lang.Object object)
Deprecated. Answers whether this map and the argument are 'the same' |
java.lang.Object |
get(java.lang.Object key)
Deprecated. Retrieves the referent of the Referenced value |
int |
hashCode()
Deprecated. Calculates the hash code for this map |
boolean |
isEmpty()
Deprecated. Answers whether there are any mappings |
java.util.Set |
keySet()
Deprecated. Returns the domain of the mappings |
void |
purge()
Deprecated. Removes References that have had their referents garbage collected |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Deprecated. Adds a key-value mapping, wrapping the value in a Reference |
void |
putAll(java.util.Map map)
Deprecated. Put all of the mappings in the argument into this wrapped map |
java.lang.Object |
remove(java.lang.Object key)
Deprecated. Removes a mapping from this map |
int |
size()
Deprecated. Returns the number of mappings in this map |
java.util.Collection |
values()
Deprecated. Returns a collection of the Referenced values |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SoftRefHashMap()
Method Detail |
public void purge()
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
key
- The key with which to retrieve the valuepublic java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public int hashCode()
hashCode
in interface java.util.Map
hashCode
in class java.lang.Object
public java.util.Set keySet()
keySet
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean equals(java.lang.Object object)
equals
in interface java.util.Map
equals
in class java.lang.Object
public int size()
size
in interface java.util.Map
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |