edu.northwestern.at.utils

## Class KeyedSets<K extends java.lang.Comparable,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,java.util.Set<V>>
    - - edu.northwestern.at.utils.KeyedSets<K,V>

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<K,java.util.Set<V>>

      public class KeyedSets<K extends java.lang.Comparable,V>
      extends java.util.HashMap<K,java.util.Set<V>>

  Maps keys and sets of values.

  This class extends HashMap to allow each key to take a HashSet of values.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyedSets()` Create a keyed sets object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Set<V>` | `add(K key, V value)` Add an entry to set for a key.
    `java.util.Set<V>` | `addAll(K key, java.util.Collection<V> collection)` Add all entries from a collection to set for a key.
    `boolean` | `contains(java.lang.Object key, V value)` Check if entry exists in set for specified key.
    `boolean` | `remove(K key, V value)` Remove an entry from set for a key.

    - ### Methods inherited from class java.util.HashMap

      `clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `equals, hashCode`

- - ### Constructor Detail

    - #### KeyedSets

          public KeyedSets()

      Create a keyed sets object.

  - ### Method Detail

    - #### contains

          public boolean contains(java.lang.Object key,
                         V value)

      Check if entry exists in set for specified key.
      Parameters:
        `key` - The key.
        `value` - Value to check.
      Returns:
        true if value found in set for key.

    - #### addAll

          public java.util.Set<V> addAll(K key,
                                java.util.Collection<V> collection)

      Add all entries from a collection to set for a key.
      Parameters:
        `key` - The key.
        `collection` - Collection whose entries should be added.
      Returns:
        Updated set.

    - #### add

          public java.util.Set<V> add(K key,
                             V value)

      Add an entry to set for a key.
      Parameters:
        `key` - The key.
        `value` - Value to add to key's set.
      Returns:
        Updated set.

    - #### remove

          public boolean remove(K key,
                       V value)

      Remove an entry from set for a key.
      Parameters:
        `key` - The key.
        `value` - Value to remove from key's set.
      Returns:
        true if entry removed.

        The key is removed should the associated list become empty.