Class AbstractTwoKeyMap<K1,K2,V>

java.lang.Object
pascal.taie.util.collection.AbstractTwoKeyMap<K1,K2,V>
All Implemented Interfaces:
Serializable, TwoKeyMap<K1,K2,V>
Direct Known Subclasses:
MapMapTwoKeyMap

public abstract class AbstractTwoKeyMap<K1,K2,V> extends Object implements TwoKeyMap<K1,K2,V>, Serializable
See Also:
  • Field Details

  • Constructor Details

    • AbstractTwoKeyMap

      public AbstractTwoKeyMap()
  • Method Details

    • containsKey

      public boolean containsKey(K1 key1, K2 key2)
      Specified by:
      containsKey in interface TwoKeyMap<K1,K2,V>
      Returns:
      true if this two-key map contains the mapping with key1 as the first key and key2 as the second key.
    • containsKey

      public boolean containsKey(K1 key1)
      Specified by:
      containsKey in interface TwoKeyMap<K1,K2,V>
      Returns:
      true if this two-key map contains at least one mapping with key1 as the first key.
    • containsValue

      public boolean containsValue(V value)
      Specified by:
      containsValue in interface TwoKeyMap<K1,K2,V>
      Returns:
      true if this two-key map contains at least one mapping with value as the value. Note that this operation may be slow compared to TwoKeyMap.containsKey(Object).
    • get

      @Nullable public V get(K1 key1, K2 key2)
      Specified by:
      get in interface TwoKeyMap<K1,K2,V>
      Returns:
      the value to which the specified keys is mapped, or null if this map contains no mapping for the keys.
    • entrySet

      public Set<TwoKeyMap.Entry<K1,K2,V>> entrySet()
      Specified by:
      entrySet in interface TwoKeyMap<K1,K2,V>
      Returns:
      an unmodifiable view of all key1-key2-value triples contained in this two-key map, as TwoKeyMap.Entry instances.
    • entryIterator

      protected abstract Iterator<TwoKeyMap.Entry<K1,K2,V>> entryIterator()
    • twoKeySet

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

      public Collection<V> values()
      Specified by:
      values in interface TwoKeyMap<K1,K2,V>
      Returns:
      an unmodifiable view collection containing the value from each key1-key2-value triples contained in this map, without collapsing duplicates (so values().size() == size()).
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface TwoKeyMap<K1,K2,V>
      Returns:
      true if this map contains no key1-key2-value mappings.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object