A collection that maps keys to values, similar to java.util.Map, but in which each key may be associated with multiple values. The values associated with the same key contain no duplicates. You can visualize the contents of a multimap either as a map from keys to nonempty</i
| 58 | * @param <V> type of the values in this map |
| 59 | */ |
| 60 | public interface MultiMap<K, V> { |
| 61 | |
| 62 | /** |
| 63 | * @return {@code true} if this multimap contains at least one key-value pair |
| 64 | * with the key {@code key} and the value {@code value}. |
| 65 | */ |
| 66 | boolean contains(K key, V value); |
| 67 | |
| 68 | /** |
| 69 | * @return {@code true} if this multimap contains at least one key-value pair |
| 70 | * with the key {@code key}. |
| 71 | */ |
| 72 | boolean containsKey(K key); |
| 73 | |
| 74 | /** |
| 75 | * @return {@code true} if this multimap contains at least one key-value pair |
| 76 | * with the value {@code value}. Note that this operation may be slow |
| 77 | * compared to {@link #containsKey(Object)} in some implementations. |
| 78 | */ |
| 79 | boolean containsValue(V value); |
| 80 | |
| 81 | /** |
| 82 | * @return an unmodifiable view of the values associated with {@code key} |
| 83 | * in this multimap, if {@code key} is absent; otherwise, this returns |
| 84 | * an empty set. |
| 85 | */ |
| 86 | Set<V> get(K key); |
| 87 | |
| 88 | /** |
| 89 | * Stores a key-value pair in this multimap. |
| 90 | * |
| 91 | * @return {@code true} if the multimap changed. |
| 92 | */ |
| 93 | boolean put(@Nonnull K key, @Nonnull V value); |
| 94 | |
| 95 | /** |
| 96 | * Stores a key-value pair in this multimap for each of {@code values}, |
| 97 | * all using the same key, {@code key}.= |
| 98 | */ |
| 99 | boolean putAll(@Nonnull K key, @Nonnull Collection<? extends V> values); |
| 100 | |
| 101 | /** |
| 102 | * Stores all key-value pairs of {@code multimap} in this multimap. |
| 103 | * |
| 104 | * @return {@code true} if the multimap changed |
| 105 | */ |
| 106 | boolean putAll(@Nonnull MultiMap<? extends K, ? extends V> multiMap); |
| 107 | |
| 108 | /** |
| 109 | * Removes a single key-value pair with the key {@code key} and the value |
| 110 | * {@code value} from this multimap, if such exists. |
| 111 | * |
| 112 | * @return {@code true} if the multimap changed |
| 113 | */ |
| 114 | boolean remove(K key, V value); |
| 115 | |
| 116 | /** |
| 117 | * Removes all values associated with the key {@code key}. |
no outgoing calls
no test coverage detected