com.ideanest.util
Class ReferenceValueHashMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--com.ideanest.util.ReferenceValueHashMap
All Implemented Interfaces:
java.util.Map
Direct Known Subclasses:
SoftValueHashMap, WeakValueHashMap

public abstract class ReferenceValueHashMap
extends java.util.AbstractMap


Constructor Summary
ReferenceValueHashMap()
          Constructs a new, empty WeakValuesHashMap with the default capacity and the default load factor, which is 0.75.
ReferenceValueHashMap(int initialCapacity)
          Constructs a new, empty WeakValuesHashMap with the given initial capacity and the default load factor, which is 0.75.
ReferenceValueHashMap(int initialCapacity, float loadFactor)
          Constructs a new, empty WeakValuesHashMap with the given initial capacity and the given load factor.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceValueHashMap

public ReferenceValueHashMap()
Constructs a new, empty WeakValuesHashMap with the default capacity and the default load factor, which is 0.75.


ReferenceValueHashMap

public ReferenceValueHashMap(int initialCapacity)
Constructs a new, empty WeakValuesHashMap with the given initial capacity and the default load factor, which is 0.75.

Parameters:
initialCapacity - The initial capacity of the WeakValuesHashMap
Throws:
java.lang.IllegalArgumentException - If the initial capacity is less than zero

ReferenceValueHashMap

public ReferenceValueHashMap(int initialCapacity,
                             float loadFactor)
Constructs a new, empty WeakValuesHashMap with the given initial capacity and the given load factor.

Parameters:
initialCapacity - The initial capacity of the WeakValuesHashMap
loadFactor - The load factor of the WeakValuesHashMap
Throws:
java.lang.IllegalArgumentException - If the initial capacity is less than zero, or if the load factor is nonpositive
Method Detail

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.AbstractMap

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class java.util.AbstractMap

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map
Overrides:
containsValue in class java.util.AbstractMap

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
Specified by:
entrySet in class java.util.AbstractMap

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.AbstractMap

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
Overrides:
isEmpty in class java.util.AbstractMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.AbstractMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.AbstractMap

size

public int size()
Specified by:
size in interface java.util.Map
Overrides:
size in class java.util.AbstractMap