Class HashManyToManyMap<K,V>

java.lang.Object
com.github.tadukoo.util.map.ManyToManyMap<K,V>
com.github.tadukoo.util.map.HashManyToManyMap<K,V>

public class HashManyToManyMap<K,V> extends ManyToManyMap<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 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 HashMultiMaps
      loadFactor - The load factor of the backing HashMultiMaps
    • HashManyToManyMap

      @SafeVarargs public HashManyToManyMap(Pair<K,V>... entries)
      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

      public HashManyToManyMap(Map<K,V> map)
      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

      public 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).
      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

      public 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).
      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

      public boolean equals(Object o)
      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 run ManyToManyMap.equals(java.lang.Object) to compare them.
      Overrides:
      equals in class ManyToManyMap<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