public class WeakCache extends AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
WeakCache()
Construct a WeakCache with weak keys.
|
WeakCache(Map map)
Construct a WeakCache.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
protected Reference |
createReference(Object value) |
Set |
entrySet() |
boolean |
equals(Object o) |
Object |
get(Object key) |
int |
hashCode() |
Set |
keySet() |
Object |
put(Object key,
Object value) |
Object |
remove(Object key) |
int |
size() |
String |
toString() |
Collection |
values() |
clone, isEmpty, putAll
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public WeakCache()
Note, that the internally used WeakHashMap is not thread-safe.
map
- the map to usepublic WeakCache(Map map)
map
- the map to usepublic Object get(Object key)
get
in interface Map
get
in class AbstractMap
public Object put(Object key, Object value)
put
in interface Map
put
in class AbstractMap
public Object remove(Object key)
remove
in interface Map
remove
in class AbstractMap
public boolean containsValue(Object value)
containsValue
in interface Map
containsValue
in class AbstractMap
public int size()
size
in interface Map
size
in class AbstractMap
public Collection values()
values
in interface Map
values
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class AbstractMap
public void clear()
clear
in interface Map
clear
in class AbstractMap
public Set keySet()
keySet
in interface Map
keySet
in class AbstractMap
public boolean equals(Object o)
equals
in interface Map
equals
in class AbstractMap
public int hashCode()
hashCode
in interface Map
hashCode
in class AbstractMap
public String toString()
toString
in class AbstractMap
Copyright © 2004–2016 XStream. All rights reserved.