Class HashSetHashMap<K,V>

All Implemented Interfaces:
CollectionMap<K,V,Set<V>>, Map<K,Set<V>>

public class HashSetHashMap<K,V> extends AbstractDecoratorCollectionMap<K,V,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 Details

    • 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:
      IllegalArgumentException - if the initial capacity is negative.
  • Method Details

    • createCollection

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