|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.apache.jdo.util.WeakValueHashMap
A WeakValueHashMap is implemented as a HashMap that maps keys to WeakValues. Because we don't have access to the innards of the HashMap, we have to wrap/unwrap value objects with WeakValues on every operation. Fortunately WeakValues are small, short-lived objects, so the added allocation overhead is tolerable. This implementaton directly extends java.util.HashMap.
HashMap
,
WeakReference
,
Serialized FormConstructor Summary | |
WeakValueHashMap()
|
Method Summary | |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value. |
java.util.Set |
entrySet()
Returns a Set view of the mappings in this map. |
java.lang.Object |
get(java.lang.Object key)
Gets the value for the given key. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts a new (key,value) into the map. |
java.lang.Object |
remove(java.lang.Object key)
Removes key and value for the given key. |
int |
size()
Returns the number of key-value mappings in this map. |
java.util.Collection |
values()
Returns a Collection view of the values contained
in this map. |
Methods inherited from class java.util.HashMap |
clear, clone, keySet, putAll |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Constructor Detail |
public WeakValueHashMap()
Method Detail |
public int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
key
- key whose presence in this map is to be tested
public boolean containsValue(java.lang.Object value)
value
- value whose presence in this map is to be tested
public java.lang.Object get(java.lang.Object key)
key
- key whose associated value, if any, is to be returned
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
public java.lang.Object remove(java.lang.Object key)
key
- key whose mapping is to be removed from the map.
public java.util.Set entrySet()
Set
view of the mappings in this map.
Set
view of the mappings in this map.public java.util.Collection values()
Collection
view of the values contained
in this map.
Collection
view of the values contained
in this map.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |