public final class WeakReferenceContainer extends Object implements Container
Note that keys are hard references; in a situation where OutOfMemory will occur, the JVM will first wipe out all unreferenced objects whose only link is a weak reference. An out of memory will wipe all values from the maps which are currently unreferenced. The keys remain until the hashbelt containers are garbage collected, an put is called with that key or when the value should be accessed through any operation of the Container interface.
| Constructor and Description |
|---|
WeakReferenceContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<Object,Object>> |
entrySet() |
Object |
get(Object key) |
long |
getTimestamp()
Returns the timestamp of this container.
|
boolean |
isEmpty() |
Iterator<Object> |
keyIterator()
Returns an iterator over the keys contained in this container.
|
Set<Object> |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map<? extends Object,? extends Object> map) |
Object |
remove(Object key) |
int |
size() |
void |
updateTimestamp()
Set the timestamp of this container to System.currentTimeMillis().
|
Iterator<Object> |
valueIterator()
Returns an iterator over the values contained in this container.
|
Collection<Object> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic void updateTimestamp()
updateTimestamp in interface Containerpublic long getTimestamp()
getTimestamp in interface Containerpublic Iterator<Object> keyIterator()
keyIterator in interface Containerpublic Iterator<Object> valueIterator()
valueIterator in interface Containerpublic boolean containsKey(Object key)
containsKey in interface Map<Object,Object>public boolean containsValue(Object value)
containsValue in interface Map<Object,Object>Copyright © 2014. All rights reserved.