java.lang.Object
gg.xp.xivapi.collections.KeyedAlikeMap<K,V>
- Type Parameters:
K- The key type.V- The value type.
- All Implemented Interfaces:
Map<K,V>
KeyedAlikeMap is a map with a defined set of allowed keys. The intent is for multiple maps which are going to have
an identical set of possible keys to share the same underlying key mapping. Assuming that enough of the possible
keys are in use, this saves memory over a traditional hash map.
Thread safety: concurrent reads are okay, and raw concurrent writes are probably fine. However, modifying the map while iterating and other combinations of simultaneous reading/writing are undefined. Methods such as size/isEmpty have undefined behavior as well if they overlap with a write.
This class is not meant to be instantiated by the user. Instead, use your key set to create a
KeyedAlikeMapFactory, which may then be used to produce KeyedAlikeMap instances.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(@Nullable Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()voidintsize()toString()@NotNull Collection<V> values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
toString
-