Save This Page
Home » jdo2-util-2.3-ea-src » org.apache.jdo.util » [javadoc | source]
org.apache.jdo.util
public class: WeakValueHashMap [javadoc | source]
java.lang.Object
   java.util.AbstractMap
      java.util.HashMap
         org.apache.jdo.util.WeakValueHashMap

All Implemented Interfaces:
    Map, Serializable, Cloneable

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.
Fields inherited from java.util.HashMap:
DEFAULT_INITIAL_CAPACITY,  MAXIMUM_CAPACITY,  DEFAULT_LOAD_FACTOR,  table,  size,  threshold,  loadFactor,  modCount
Fields inherited from java.util.AbstractMap:
keySet,  values
Method from org.apache.jdo.util.WeakValueHashMap Summary:
containsKey,   containsValue,   entrySet,   get,   isEmpty,   put,   remove,   size,   values
Methods from java.util.HashMap:
addEntry,   capacity,   clear,   clone,   containsKey,   containsValue,   createEntry,   entrySet,   get,   getEntry,   hash,   indexFor,   init,   isEmpty,   keySet,   loadFactor,   newEntryIterator,   newKeyIterator,   newValueIterator,   put,   putAll,   remove,   removeEntryForKey,   removeMapping,   resize,   size,   transfer,   values
Methods from java.util.AbstractMap:
access$000,   clear,   clone,   containsKey,   containsValue,   entrySet,   equals,   get,   hashCode,   isEmpty,   keySet,   put,   putAll,   remove,   size,   toString,   values
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.util.WeakValueHashMap Detail:
 public boolean containsKey(Object key) 
    Returns true if this map contains a mapping for the specified key.

 public boolean containsValue(Object value) 
    Returns true if this map maps one or more keys to the specified value.

 public Set entrySet() 
    Returns a Set view of the mappings in this map.

 public Object get(Object key) 
    Gets the value for the given key.

 public boolean isEmpty() 
    Returns true if this map contains no key-value mappings.

 public Object put(Object key,
    Object value) 
    Puts a new (key,value) into the map.

 public Object remove(Object key) 
    Removes key and value for the given key.

 public int size() 
    Returns the number of key-value mappings in this map.

 public Collection values() 
    Returns a Collection view of the values contained in this map.