|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
org.geotools.util.WeakValueHashMap
A hashtable-based Map
implementation with weak values. An entry in a
WeakValueHashMap
will automatically be removed when its value is no longer
in ordinary use. This class is similar to the standard WeakHashMap
class provided
is J2SE, except that weak references are hold on values instead of keys.
The WeakValueHashMap
class is thread-safe.
WeakHashMap
,
WeakHashSet
Constructor Summary | |
WeakValueHashMap()
Construct a WeakValueHashMap . |
Method Summary | |
void |
clear()
Removes all of the elements from this map. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to this value. |
java.util.Set |
entrySet()
Returns a set view of the mappings contained in this map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which this map maps the specified key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present. |
int |
size()
Returns the number of key-value mappings in this map. |
Methods inherited from class java.util.AbstractMap |
clone, equals, hashCode, isEmpty, keySet, putAll, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WeakValueHashMap()
WeakValueHashMap
.
Method Detail |
public int size()
public boolean containsValue(java.lang.Object value)
true
if this map maps one or more keys to this value.
value
- value whose presence in this map is to be tested.
true
if this map maps one or more keys to this value.public boolean containsKey(java.lang.Object key)
true
if this map contains a mapping for the specified key.
key
- key whose presence in this map is to be tested.
true
if this map contains a mapping for the specified key.
java.lang.NullPointerException
- If key is null
.public java.lang.Object get(java.lang.Object key)
null
if the map contains no mapping for this key.
key
- Key whose associated value is to be returned.
java.lang.NullPointerException
- if the key is null
.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
WeakReference
.
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
null
if there was no mapping for key.
java.lang.NullPointerException
- if the key or the value is null
.public java.lang.Object remove(java.lang.Object key)
key
- key whose mapping is to be removed from the map.
null
if there was no entry for key.public void clear()
public java.util.Set entrySet()
Map.Entry
.
The current implementation thrown UnsupportedOperationException
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |