public class TrackingMap<K,V> extends Object implements Map<K,V>
Constructor and Description |
---|
TrackingMap(Map<K,V> map)
Wrap the passed in Map with a TrackingMap.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object other) |
void |
expungeUnused()
Remove the entries from the Map that have not been accessed by .get() or .containsKey().
|
V |
get(Object key) |
Map |
getWrappedMap()
Fetch the Map that this TrackingMap wraps.
|
int |
hashCode() |
void |
informAdditionalUsage(Collection<K> additional)
Add the Collection of keys to the internal list of keys accessed.
|
void |
informAdditionalUsage(TrackingMap<K,V> additional)
Add the used keys from the passed in TrackingMap to this TrackingMap's keysUsed.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
Set<K> |
keysUsed()
Fetch the Set of keys that have been accessed via .get() or .containsKey() of the contained Map.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean equals(Object other)
public int hashCode()
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public void expungeUnused()
public void informAdditionalUsage(Collection<K> additional)
additional
- Collection of keys to add to the list of keys read.public void informAdditionalUsage(TrackingMap<K,V> additional)
additional
- TrackingMap whose used keys are to be added to this maps used keys.public Set<K> keysUsed()
public Map getWrappedMap()
Copyright © 2016. All rights reserved.