Package io.joynr.util

Class MultiMap<K,​V>

    • Constructor Detail

      • MultiMap

        public MultiMap()
    • Method Detail

      • containsKey

        public boolean containsKey​(K key)
        Parameters:
        key - key
        Returns:
        true if at least one key-value pair exists for key
      • isEmpty

        public boolean isEmpty()
        Returns:
        true if empty
      • get

        public Set<V> get​(K key)
        Parameters:
        key - key
        Returns:
        a set view of the values associated with key
      • put

        public void put​(K key,
                        V value)
        Stores a key-value pair.
        Parameters:
        key - key
        value - value
      • getAndRemoveAll

        public Set<V> getAndRemoveAll​(K key)
        Parameters:
        key - key
        Returns:
        a set view of the values associated with key then remove it from the container storage
      • remove

        public boolean remove​(K key,
                              V value)
        Removes key-value pair if it exists.
        Parameters:
        key - key
        value - value
        Returns:
        true if pair was removed, false otherwise
      • removeAll

        public void removeAll​(K key)
        Removes all values associated with key.
        Parameters:
        key - key
      • keySet

        public Set<K> keySet()
        Returns:
        a set view of the keys contained in this multimap
      • size

        public int size()
        Returns:
        number of key-value pairs in this multimap