Package com.github.tadukoo.util.map
Class HashManyToManyMap<K,V>
java.lang.Object
com.github.tadukoo.util.map.ManyToManyMap<K,V>
com.github.tadukoo.util.map.HashManyToManyMap<K,V>
A ManyToManyMap class that uses
HashMultiMap
as the backing MultiMap
class.- Since:
- Pre-Alpha
- Version:
- Alpha v.0.2
- Author:
- Logan Ferree (Tadukoo)
-
Constructor Summary
ConstructorDescriptionCreates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75).HashManyToManyMap
(int initialCapacity) Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the specified initial capacity and the default load factor (0.75).HashManyToManyMap
(int initialCapacity, float loadFactor) Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the specified initial capacity and load factor.HashManyToManyMap
(ManyToManyMap<K, V> manyToManyMap) Creates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75).HashManyToManyMap
(MultiMap<K, V> multiMap) Creates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75).HashManyToManyMap
(Pair<K, V>... entries) Creates a new HashManyToManyMap where the given Pairs are loaded into the map right away.HashManyToManyMap
(Map<K, V> map) Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the same mappings as the specified Map. -
Method Summary
Methods inherited from class com.github.tadukoo.util.map.ManyToManyMap
clear, containsKey, containsValue, forEach, getKeys, getValues, isEmpty, keySet, keySetSize, keysToValues, put, putAllKeys, putAllKeyValMappings, putAllKeyValMappings, putAllKeyValMappings, putAllKeyValMappings, putAllValKeyMappings, putAllValKeyMappings, putAllValKeyMappings, putAllValKeyMappings, putAllValues, remove, removeEntireKeysList, removeEntireValuesList, removeKey, removeValue, replaceEntireKeyList, replaceEntireKeyList, replaceEntireValueList, replaceEntireValueList, replaceKey, replaceValue, size, valueSet, valueSetSize, valuesToKeys
-
Constructor Details
-
HashManyToManyMap
public HashManyToManyMap()Creates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75). -
HashManyToManyMap
public HashManyToManyMap(int initialCapacity) Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity
- The initial capacity of the backing HashMultiMaps
-
HashManyToManyMap
public HashManyToManyMap(int initialCapacity, float loadFactor) Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the specified initial capacity and load factor.- Parameters:
initialCapacity
- The initial capacity of the backing HashMultiMapsloadFactor
- The load factor of the backing HashMultiMaps
-
HashManyToManyMap
Creates a new HashManyToManyMap where the given Pairs are loaded into the map right away.- Parameters:
entries
- A collection of key-value Pairs to be put in this ManyToManyMap
-
HashManyToManyMap
Creates a new HashManyToManyMap where the backing HashMultiMaps are constructed with the same mappings as the specified Map. The HashMultiMap 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 HashMultiMaps
-
HashManyToManyMap
Creates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75).
The ManyToManyMap is then populated with the values present in the specified MultiMap.- Parameters:
multiMap
- The MultiMap whose mappings are to be placed in this ManyToManyMap
-
HashManyToManyMap
Creates a new HashManyToManyMap where the backing HashMultiMap is constructed with the default initial capacity (16) and the default load factor (0.75).
The ManyToManyMap is then populated with the values present in the specified ManyToManyMap.- Parameters:
manyToManyMap
- The ManyToManyMap whose mappings are to be placed in this ManyToManyMap
-
-
Method Details
-
equals
Compares the given object with this HashManyToManyMap for equality. Returns true if the given object is also a HashManyToManyMap and the two HashManyToManyMaps represent the same mappings. If they're both HashManyToManyMaps, it will runManyToManyMap.equals(java.lang.Object)
to compare them.- Overrides:
equals
in classManyToManyMap<K,
V> - Parameters:
o
- The object to be compared for equality with this HashManyToManyMap- Returns:
- true if the given object is equivalent to this HashManyToManyMap
-