com.thoughtworks.xstream.core.util
Class WeakCache
java.lang.Object
java.util.AbstractMap
com.thoughtworks.xstream.core.util.WeakCache
- All Implemented Interfaces:
- Map
public class WeakCache
- extends AbstractMap
A HashMap implementation with weak references values and by default for the key. WHen the
value is garbage collected, the key will also vanish from the map.
- Since:
- 1.4
- Author:
- Jörg Schaible
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
|
Constructor Summary |
WeakCache()
Construct a WeakCache with weak keys. |
WeakCache(Map map)
Construct a WeakCache. |
WeakCache
public WeakCache()
- Construct a WeakCache with weak keys.
- Parameters:
map - the map to use- Since:
- 1.4
WeakCache
public WeakCache(Map map)
- Construct a WeakCache.
- Parameters:
map - the map to use- Since:
- 1.4
get
public Object get(Object key)
- Specified by:
get in interface Map- Overrides:
get in class AbstractMap
put
public Object put(Object key,
Object value)
- Specified by:
put in interface Map- Overrides:
put in class AbstractMap
remove
public Object remove(Object key)
- Specified by:
remove in interface Map- Overrides:
remove in class AbstractMap
createReference
protected Reference createReference(Object value)
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map- Overrides:
containsValue in class AbstractMap
size
public int size()
- Specified by:
size in interface Map- Overrides:
size in class AbstractMap
values
public Collection values()
- Specified by:
values in interface Map- Overrides:
values in class AbstractMap
entrySet
public Set entrySet()
- Specified by:
entrySet in interface Map- Specified by:
entrySet in class AbstractMap
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map- Overrides:
containsKey in class AbstractMap
clear
public void clear()
- Specified by:
clear in interface Map- Overrides:
clear in class AbstractMap
keySet
public Set keySet()
- Specified by:
keySet in interface Map- Overrides:
keySet in class AbstractMap
equals
public boolean equals(Object o)
- Specified by:
equals in interface Map- Overrides:
equals in class AbstractMap
hashCode
public int hashCode()
- Specified by:
hashCode in interface Map- Overrides:
hashCode in class AbstractMap
toString
public String toString()
- Overrides:
toString in class AbstractMap
Copyright © 2012. All Rights Reserved.