K - The type of the keyV - The type of the valuepublic class TimedMap<K,V> extends Object implements Map<K,V>
Map implementation that forgets its entries after a specified time.| Constructor and Description |
|---|
TimedMap()
Creates a new timed map with a default maximum age of 60 seconds.
|
TimedMap(long maximumAge)
Creates a new timed map.
|
TimedMap(long maximumAge,
Map<K,V> original)
Creates a new timed map, copying the given map.
|
TimedMap(Map<K,V> original)
Creates a new timed map with a default maximum age of 60 seconds, copying
the given map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic TimedMap()
public TimedMap(long maximumAge)
maximumAge - The maximum age for items (in milliseconds)public TimedMap(Map<K,V> original)
original - The map to copyCopyright © 2026. All rights reserved.