Class AbstractSetValuedMap<K,​V>

    • Constructor Detail

      • AbstractSetValuedMap

        protected AbstractSetValuedMap()
        Constructor needed for subclass serialization.
      • AbstractSetValuedMap

        protected AbstractSetValuedMap​(java.util.Map<K,​? extends java.util.Set<V>> map)
        A constructor that wraps, not copies
        Parameters:
        map - the map to wrap, must not be null
        Throws:
        java.lang.NullPointerException - if the map is null
    • Method Detail

      • get

        public java.util.Set<Vget​(K key)
        Gets the set of values associated with the specified key. This would return an empty set in case the mapping is not present
        Specified by:
        get in interface MultiValuedMap<K,​V>
        Specified by:
        get in interface SetValuedMap<K,​V>
        Overrides:
        get in class AbstractMultiValuedMap<K,​V>
        Parameters:
        key - the key to retrieve
        Returns:
        the Set of values, will return an empty Set for no mapping
      • remove

        public java.util.Set<Vremove​(java.lang.Object key)
        Removes all values associated with the specified key.

        A subsequent get(Object) would return an empty set.

        Specified by:
        remove in interface MultiValuedMap<K,​V>
        Specified by:
        remove in interface SetValuedMap<K,​V>
        Overrides:
        remove in class AbstractMultiValuedMap<K,​V>
        Parameters:
        key - the key to remove values from
        Returns:
        the Set of values removed, will return an empty, unmodifiable set for no mapping found.