Interface MultiValMap<K,V>

  • Type Parameters:
    K - keys type.
    V - values type.
    All Known Implementing Classes:
    HashMultiValMap


    public interface MultiValMap<K,V>
    • Method Summary

      Modifier and Type Method and Description
      boolean containsKey(K key)
      Find out whether the given key has any values associated.
      Collection<V> get(K key)
      Retrieve a collection of values associated with key.
      Collection<K> keys()
      Get a collection of associated keys.
      void put(K key, Collection<V> values)
      Associate all value with this key.
      void put(K key, V value)
      Associate value with key.
      void remove(K key, Collection<V> values)
      Remove all given values from the key.
      void remove(K key, V value)
      Remove this value from the key.
      void removeAll(K key)
      Remove all values associated with this key.
      int size()
      Get the number of keys in this map.
    • Method Detail

      • put

        void put(K key,
                 V value)
        Associate value with key.
        Parameters:
        key - the key to add.
        value - the associated value.
      • put

        void put(K key,
                 Collection<V> values)
        Associate all value with this key.
        Parameters:
        key - a key.
        values - associated values.
      • remove

        void remove(K key,
                    V value)
        Remove this value from the key.
        Parameters:
        key - the key to remove the value from.
        value - the value to remove.
      • remove

        void remove(K key,
                    Collection<V> values)
        Remove all given values from the key.
        Parameters:
        key - the key to remove values from.
        values - the value to remove.
      • removeAll

        void removeAll(K key)
        Remove all values associated with this key.
        Parameters:
        key - the key to remove all values from.
      • get

        Collection<V> get(K key)
        Retrieve a collection of values associated with key.
        Parameters:
        key - the key to look up.
        Returns:
        a collection of associated values.
      • containsKey

        boolean containsKey(K key)
        Find out whether the given key has any values associated.
        Parameters:
        key - the key to look up.
        Returns:
        true if this key exists.
      • keys

        Collection<K> keys()
        Get a collection of associated keys.
        Returns:
        the collection of keys registred.
      • size

        int size()
        Get the number of keys in this map.
        Returns:
        the number of keys.