API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. WeakHashMap View Source
Author(s)
Doug Lea
Josh Bloch
Mark Reinhold
Since
1.2
Version
1.39, 05/24/06
Serial
Hierarchy
 Object
      AbstractMap
          WeakHashMap
Implements
 Map
Subclasses
Description
public class WeakHashMap
  A hashtable-based Map implementation with weak keys.
See also:    HashMap WeakReference
Constructors
public WeakHashMap ()
Constructs a new, empty WeakHashMap with the default initial capacity (16) and load factor (0.75).
public WeakHashMap (int initialCapacity)
  Constructs a new, empty WeakHashMap with the given initial capacity and the default load factor (0.75).
public WeakHashMap (int initialCapacity, float loadFactor)
  Constructs a new, empty WeakHashMap with the given initial capacity and the given load factor.
public WeakHashMap (Map<Object, Object> m)
  Constructs a new WeakHashMap with the same mappings as the specified map.
Methods
Hide/Show inherited methods
public void clear () [Overrides AbstractMap] [Specified in Map]
  Removes all of the mappings from this map.
protected Object clone () throws CloneNotSupportedException [Inherited From AbstractMap]
  Returns a shallow copy of this AbstractMap instance: the keys and values themselves are not cloned.
public boolean containsKey (Object key) [Overrides AbstractMap] [Specified in Map]
  Returns true if this map contains a mapping for the specified key.
public boolean containsValue (Object value) [Overrides AbstractMap] [Specified in Map]
  Returns true if this map maps one or more keys to the specified value.
public Set<Entry< K, V>> entrySet () [Specified in Map]
  Returns a Set view of the mappings contained in this map.
pack-privatestatic boolean eq (Object x, Object y)
  Checks for equality of non-null reference x and possibly-null y.
public boolean equals (Object o) [Inherited From AbstractMap]
  Compares the specified object with this map for equality.
public V get (Object key) [Overrides AbstractMap] [Specified in Map]
  Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
pack-private Entry< K, V> getEntry (Object key)
  Returns the entry associated with the specified key in this map.
public int hashCode () [Inherited From AbstractMap]
  Returns the hash code value for this map.
pack-privatestatic int indexFor (int h, int length)
Returns index for hash code h.
public boolean isEmpty () [Overrides AbstractMap] [Specified in Map]
  Returns true if this map contains no key-value mappings.
public Set< K> keySet () [Overrides AbstractMap] [Specified in Map]
  Returns a Set view of the keys contained in this map.
public V put ( K key, V value) [Overrides AbstractMap] [Specified in Map]
  Associates the specified value with the specified key in this map.
public void putAll (Map<Object, Object> m) [Overrides AbstractMap] [Specified in Map]
  Copies all of the mappings from the specified map to this map.
public V remove (Object key) [Overrides AbstractMap] [Specified in Map]
  Removes the mapping for a key from this weak hash map if it is present.
pack-private Entry< K, V> removeMapping (Object o)
Special version of remove needed by Entry set
pack-private void resize (int newCapacity)
  Rehashes the contents of this map into a new array with a larger capacity.
public int size () [Overrides AbstractMap] [Specified in Map]
  Returns the number of key-value mappings in this map.
public String toString () [Inherited From AbstractMap]
  Returns a string representation of this map.
public Collection< V> values () [Overrides AbstractMap] [Specified in Map]
  Returns a Collection view of the values contained in this map.
Fields
Hide/Show inherited fields
pack-privatetransientvolatile Set< K> keySet [Inherited From AbstractMap]
  Each of these fields are initialized to contain an instance of the appropriate view the first time this view is requested.
pack-privatetransientvolatile Collection< V> values [Inherited From AbstractMap]
Nested Classes
  AbstractMap.SimpleEntry
An Entry maintaining a key and a value.
  AbstractMap.SimpleImmutableEntry
An Entry maintaining an immutable key and value.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar