Class MapMultiMapTwoKeyMultiMap<K1,K2,V>

java.lang.Object
pascal.taie.util.collection.AbstractTwoKeyMultiMap<K1,K2,V>
pascal.taie.util.collection.MapMultiMapTwoKeyMultiMap<K1,K2,V>
All Implemented Interfaces:
Serializable, TwoKeyMultiMap<K1,K2,V>

public class MapMultiMapTwoKeyMultiMap<K1,K2,V> extends AbstractTwoKeyMultiMap<K1,K2,V>
Implements TwoKeyMultiMap as map of multimaps.
See Also:
  • Constructor Details

  • Method Details

    • contains

      public boolean contains(K1 key1, K2 key2, V value)
      Returns:
      true if given key1-key2-value mapping is contained in this two-key multimap.
    • containsKey

      public boolean containsKey(K1 key1, K2 key2)
      Returns:
      true if this two-key multimap contains the mapping with key1 as the first key and key2 as the second key.
    • containsKey

      public boolean containsKey(K1 key1)
      Returns:
      true if this two-key multimap contains at least one mapping with key1 as the first key.
    • containsValue

      public boolean containsValue(V value)
      Returns:
      true if this two-key multimap contains at least one mapping with value as the value. Note that this operation may be slow compared to TwoKeyMultiMap.containsKey(Object).
    • get

      public Set<V> get(K1 key1, K2 key2)
      Returns:
      an unmodifiable view of the values associated with given keys in this multimap, if the two-key pair is absent; otherwise, returns an empty set.
    • get

      public MultiMap<K2,V> get(K1 key1)
      Returns:
      an unmodifiable view of the values associated with given key in this two-key multimap, if the key is absent; otherwise, returns an empty multimap.
    • put

      public boolean put(@Nonnull K1 key1, @Nonnull K2 key2, @Nonnull V value)
      Description copied from interface: TwoKeyMultiMap
      Stores a key1-key2-value triple in this two-key multimap.
      Returns:
      true if this two-key multimap changed.
    • remove

      public boolean remove(K1 key1, K2 key2, V value)
      Description copied from interface: TwoKeyMultiMap
      Removes a single key1-key2-value triple from this two-key multimap, if it exists.
      Returns:
      true if the two-key multimap changed
    • removeAll

      public boolean removeAll(K1 key1, K2 key2)
      Description copied from interface: TwoKeyMultiMap
      Removes all values associated with the two-key pair.
      Returns:
      true if the multimap changed.
    • entryIterator

      protected Iterator<TwoKeyMap.Entry<K1,K2,V>> entryIterator()
      Specified by:
      entryIterator in class AbstractTwoKeyMultiMap<K1,K2,V>
    • twoKeySet

      public Set<Pair<K1,K2>> twoKeySet()
      Returns:
      an unmodifiable view of all distinct two-key pairs contained in this two-key multimap. Note that the result contains a two-key pair if and only if this map maps that key pair to at least one non-null value.
    • clear

      public void clear()
      Description copied from interface: TwoKeyMultiMap
      Removes all the mappings from this map. The map will be empty after this call returns.
    • size

      public int size()
      Returns:
      the number of key1-key2-value mappings in this map.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object