|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xbean.propertyeditor.ReferenceIdentityMap
public class ReferenceIdentityMap
Streamlined version of a WeakIdentityHashMap. Provides Identity semantics with
Weak References to keys. This allows proxies to be GC'ed when no longer referenced
by clients. BasicProxymanager.destroyProxy()
need not be invoked when a
proxy is no longer needed. Note that this is not a full Map implementation.
The iteration and collection capabilities of Map have been discarded to keep the
implementation lightweight.
Much of this code was cribbed from the Commons Collection 3.1 implementation of
ReferenceIdentityMap
and AbstractReferenceMap
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
ReferenceIdentityMap()
|
Method Summary | |
---|---|
void |
clear()
Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues. |
boolean |
containsKey(java.lang.Object key)
Checks whether the map contains the specified key. |
boolean |
containsValue(java.lang.Object value)
Checks whether the map contains the specified value. |
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
Gets the value mapped to the key specified. |
boolean |
isEmpty()
Checks whether the map is currently empty. |
java.util.Set |
keySet()
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts a key-value entry into this map. |
void |
putAll(java.util.Map t)
|
java.lang.Object |
remove(java.lang.Object key)
Removes the specified mapping from this map. |
int |
size()
Gets the size of the map. |
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public ReferenceIdentityMap()
Method Detail |
---|
public int size()
size
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
key
- the key to search for
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
value
- the value to search for
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
key
- the key
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
key
- the key to add, must not be nullvalue
- the value to add, must not be null
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
key
- the mapping to remove
public void clear()
clear
in interface java.util.Map
public java.util.Collection values()
values
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.util.Set keySet()
keySet
in interface java.util.Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |