|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
com.sun.jdo.spi.persistence.utility.WeakValueHashMap
public class 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 Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
WeakValueHashMap()
|
|
| Method Summary | |
|---|---|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value. |
Set |
entrySet()
Returns a Set view of the mappings in this map. |
Object |
get(Object key)
Gets the value for the given key. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
Object |
put(Object key,
Object value)
Puts a new (key,value) into the map. |
Object |
remove(Object key)
Removes key and value for the given key. |
int |
size()
Returns the number of key-value mappings in this map. |
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()
size in interface Mapsize in class HashMappublic boolean isEmpty()
isEmpty in interface MapisEmpty in class HashMappublic boolean containsKey(Object key)
containsKey in interface MapcontainsKey in class HashMapkey - key whose presence in this map is to be tested
public boolean containsValue(Object value)
containsValue in interface MapcontainsValue in class HashMapvalue - value whose presence in this map is to be tested
public Object get(Object key)
get in interface Mapget in class HashMapkey - key whose associated value, if any, is to be returned
public Object put(Object key,
Object value)
put in interface Mapput in class HashMapkey - key with which the specified value is to be associated.value - value to be associated with the specified key.
public Object remove(Object key)
remove in interface Mapremove in class HashMapkey - key whose mapping is to be removed from the map.
public Set entrySet()
Set view of the mappings in this map.
entrySet in interface MapentrySet in class HashMapSet view of the mappings in this map.public Collection values()
Collection view of the values contained
in this map.
values in interface Mapvalues in class HashMapCollection view of the values contained
in this map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||