java.lang.Object
io.github.thecsdev.tcdcommons.api.util.collections.HookedMap<K,V>
- All Implemented Interfaces:
Map<K,V>
public final class HookedMap<K,V>
extends Object
implements Map<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
-
Method Summary
final void
final boolean
final boolean
final boolean
Creates and returns a new
HookedMap
instance that is based on another
Map
.
final void
final int
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
of
Creates and returns a new
HookedMap
instance that is based on another
Map
.
- Type Parameters:
K
- The Map
key type.
V
- The Map
value type.
- Parameters:
map
- The Map
to "hook".
accessHook
- The "hook" that will be invoked upon accessing the Map
.
-
get
- Specified by:
get
in interface Map<K,V>
-
put
public final V put(K key,
V value)
- Specified by:
put
in interface Map<K,V>
-
size
public final int size()
- Specified by:
size
in interface Map<K,V>
-
isEmpty
public final boolean isEmpty()
- Specified by:
isEmpty
in interface Map<K,V>
-
-
-
putAll
public final void putAll(Map<? extends K,? extends V> m)
- Specified by:
putAll
in interface Map<K,V>
-
-
clear
public final void clear()
- Specified by:
clear
in interface Map<K,V>
-
keySet
public final Set<K> keySet()
- Specified by:
keySet
in interface Map<K,V>
-
-
entrySet
- Specified by:
entrySet
in interface Map<K,V>