Package com.github.tadukoo.util.map
Class HashMultiMap<K,V>
java.lang.Object
com.github.tadukoo.util.map.MultiMap<K,V>
com.github.tadukoo.util.map.HashMultiMap<K,V>
- Since:
- Pre-Alpha
- Version:
- Alpha v.0.2
- Author:
- Logan Ferree (Tadukoo)
-
Constructor Summary
ConstructorDescriptionCreates a new HashMultiMap where the backing HashMap is constructed with the default initial capacity (16) and the default load factor (0.75).HashMultiMap
(int initialCapacity) Creates a new HashMultiMap where the backing HashMap is constructed with the specified initial capacity and the default load factor (0.75).HashMultiMap
(int initialCapacity, float loadFactor) Creates a new HashMultiMap where the backing HashMap is constructed with the specified initial capacity and load factor.HashMultiMap
(MultiMap<K, V> multiMap) Creates a new HashMultiMap where the backing HashMap is constructed with the default initial capacity (16) and the default load factor (0.75).HashMultiMap
(Pair<K, V>... entries) Creates a new HashMultiMap where the given Pairs are loaded into the map right away.HashMultiMap
(Map<K, V> map) Creates a new HashMultiMap where the backing HashMap is constructed with the same mappings as the specified Map. -
Method Summary
Methods inherited from class com.github.tadukoo.util.map.MultiMap
clear, containsKey, containsValue, forEach, get, isEmpty, keySet, keySetSize, put, putAll, putAll, putAll, putAll, remove, removeEntireList, removeKey, replace, replaceEntireList, replaceEntireList, size, values
-
Constructor Details
-
HashMultiMap
public HashMultiMap()Creates a new HashMultiMap where the backing HashMap is constructed with the default initial capacity (16) and the default load factor (0.75). -
HashMultiMap
public HashMultiMap(int initialCapacity) Creates a new HashMultiMap where the backing HashMap is constructed with the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity
- The initial capacity of the backing HashMap
-
HashMultiMap
public HashMultiMap(int initialCapacity, float loadFactor) Creates a new HashMultiMap where the backing HashMap is constructed with the specified initial capacity and load factor.- Parameters:
initialCapacity
- The initial capacity of the backing HashMaploadFactor
- The load factor of the backing HashMap
-
HashMultiMap
Creates a new HashMultiMap where the given Pairs are loaded into the map right away.- Parameters:
entries
- The Pairs to be placed in this MultiMap
-
HashMultiMap
Creates a new HashMultiMap where the backing HashMap is constructed with the same mappings as the specified Map. The HashMap is created with default load factor (0.75) and an initial capacity sufficient to hold the mappings in the specified Map.- Parameters:
map
- The Map whose mappings are to be placed in the backing HashMap
-
HashMultiMap
Creates a new HashMultiMap where the backing HashMap is constructed with the default initial capacity (16) and the default load factor (0.75).
The MultiMap is then populated with the values present in the specified MultiMap.- Parameters:
multiMap
- The MultiMap whose mappings are to be placed in this MultiMap
-
-
Method Details
-
equals
Compares the given object with this HashMultiMap for equality. Returns true if the given object is also a HashMultiMap and the two HashMultiMaps represent the same mappings. If they're both HashMultiMaps, it will runMultiMap.equals(java.lang.Object)
to compare them. -
asMap
Returns the underlyingHashMap
of this HashMultiMap.
-