Map
public class ReferenceIdentityMap extends Object implements Map
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
.
Constructor | Description |
---|---|
ReferenceIdentityMap() |
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Clears the map, resetting the size to zero and nullifying references
to avoid garbage collection issues.
|
boolean |
containsKey(Object key) |
Checks whether the map contains the specified key.
|
boolean |
containsValue(Object value) |
Checks whether the map contains the specified value.
|
Set |
entrySet() |
|
Object |
get(Object key) |
Gets the value mapped to the key specified.
|
boolean |
isEmpty() |
Checks whether the map is currently empty.
|
Set |
keySet() |
|
Object |
put(Object key,
Object value) |
Puts a key-value entry into this map.
|
void |
putAll(Map t) |
|
Object |
remove(Object key) |
Removes the specified mapping from this map.
|
int |
size() |
Gets the size of the map.
|
Collection |
values() |
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map
key
- the key to search forpublic boolean containsValue(Object value)
containsValue
in interface Map
value
- the value to search forpublic Object put(Object key, Object value)
public void clear()
public Collection values()
Copyright © 2005–2018. All rights reserved.