|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
edu.emory.mathcs.backport.java.util.AbstractMap
edu.emory.mathcs.util.collections.AsyncWeakValueMap
edu.emory.mathcs.util.collections.AsyncWeakValueHashMap
Hash map that refers to values via weak references, thus not
keeping them from garbage collection, asynchronously removing entries
which values have been unreferenced and garbage collected. This class
is a companion to WeakHashMap
.
Nested Class Summary |
Nested classes inherited from class edu.emory.mathcs.backport.java.util.AbstractMap |
AbstractMap.SimpleEntry, AbstractMap.SimpleImmutableEntry |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Constructor Summary | |
AsyncWeakValueHashMap()
Creates new AsyncWeakValueHashMap with a default initial capacity and a default load factor. |
|
AsyncWeakValueHashMap(int initialCapacity)
Creates new AsyncWeakValueHashMap with specified initial capacity and a default load factor. |
|
AsyncWeakValueHashMap(int initialCapacity,
float loadFactor)
Creates new AsyncWeakValueHashMap with specified initial capacity and load factor. |
|
AsyncWeakValueHashMap(java.util.Map t)
Creates new AsyncWeakValueHashMap with specified initial capacity and a default load factor, and copies to it all the mappings from the specified map. |
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)
|
void |
putAll(java.util.Map t)
|
java.lang.Object |
putIfAbsent(java.lang.Object key,
java.lang.Object value)
If the specified key is not already associated with a value, associate it with the given value. |
java.lang.Object |
remove(java.lang.Object key)
|
boolean |
remove(java.lang.Object key,
java.lang.Object value)
Removes the entry for a key only if currently mapped to a given value. |
java.lang.Object |
replace(java.lang.Object key,
java.lang.Object newVal)
Replaces the entry for a key only if currently mapped to some value. |
boolean |
replace(java.lang.Object key,
java.lang.Object oldVal,
java.lang.Object newVal)
Replaces the entry for a key only if currently mapped to a given value. |
int |
size()
|
Methods inherited from class edu.emory.mathcs.backport.java.util.AbstractMap |
keySet |
Methods inherited from class java.util.AbstractMap |
clone, equals, hashCode, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode, keySet, values |
Constructor Detail |
public AsyncWeakValueHashMap(int initialCapacity, float loadFactor)
java.util.HashMap(int,float)
public AsyncWeakValueHashMap(int initialCapacity)
java.util.HashMap(int)
public AsyncWeakValueHashMap()
java.util.HashMap(int)
public AsyncWeakValueHashMap(java.util.Map t)
java.util.HashMap(int)
Method Detail |
public int size()
size
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public void putAll(java.util.Map t)
putAll
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public boolean remove(java.lang.Object key, java.lang.Object value)
ConcurrentMap
if (map.containsKey(key) && map.get(key).equals(value)) { map.remove(key); return true; } else return false;except that the action is performed atomically.
remove
in interface ConcurrentMap
key
- key with which the specified value is associatedvalue
- value expected to be associated with the specified key
public boolean replace(java.lang.Object key, java.lang.Object oldVal, java.lang.Object newVal)
ConcurrentMap
if (map.containsKey(key) && map.get(key).equals(oldValue)) { map.put(key, newValue); return true; } else return false;except that the action is performed atomically.
replace
in interface ConcurrentMap
key
- key with which the specified value is associatedoldVal
- value expected to be associated with the specified keynewVal
- value to be associated with the specified key
public java.lang.Object replace(java.lang.Object key, java.lang.Object newVal)
ConcurrentMap
if (map.containsKey(key)) { return map.put(key, value); } else return null;except that the action is performed atomically.
replace
in interface ConcurrentMap
key
- key with which the specified value is associatednewVal
- value to be associated with the specified key
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
public java.lang.Object putIfAbsent(java.lang.Object key, java.lang.Object value)
ConcurrentMap
if (!map.containsKey(key)) return map.put(key, value); else return map.get(key);except that the action is performed atomically.
putIfAbsent
in interface ConcurrentMap
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |