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, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public void updateTimestamp()
updateTimestamp
in interface Container
public long getTimestamp()
getTimestamp
in interface Container
public Iterator<Object> keyIterator()
keyIterator
in interface Container
public Iterator<Object> valueIterator()
valueIterator
in interface Container
public boolean containsKey(Object key)
containsKey
in interface Map<Object,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<Object,Object>
Copyright © 2016. All rights reserved.