Class HashSetHashMap<K,​V>

  • All Implemented Interfaces:
    CollectionMap<K,​V,​java.util.Set<V>>, java.util.Map<K,​java.util.Set<V>>

    public class HashSetHashMap<K,​V>
    extends AbstractDecoratorCollectionMap<K,​V,​java.util.Set<V>>
    An implementation of a HashMap that stores an HashSet of values for each key, with special methods for retrieving single values.
    Author:
    Garret Wilson
    • Constructor Detail

      • HashSetHashMap

        public HashSetHashMap()
        Default constructor that decorates a HashMap.
      • HashSetHashMap

        public HashSetHashMap​(int initialCapacity)
        Initial capacity constructor that decorates a HashMap.
        Parameters:
        initialCapacity - the initial capacity.
        Throws:
        java.lang.IllegalArgumentException - if the initial capacity is negative.
    • Method Detail

      • createCollection

        public java.util.Set<V> createCollection()
        Creates a collection in which to store values. This version returns an HashSet.
        Returns:
        The collections with the values stored.