Class IdentityMultiMap<K,V>

java.lang.Object
org.semanticweb.owlapitools.decomposition.IdentityMultiMap<K,V>
Type Parameters:
K - key
V - value
All Implemented Interfaces:
Serializable

public class IdentityMultiMap<K,V> extends Object implements Serializable
Author:
ignazio palmisano
See Also:
  • Constructor Details

    • IdentityMultiMap

      public IdentityMultiMap()
  • Method Details

    • put

      public boolean put(K key, V value)
      Parameters:
      key - key
      value - value
      Returns:
      true if changes happen
    • setEntry

      public void setEntry(K key, Collection<V> values)
      Parameters:
      key - key
      values - values
    • get

      public Collection<V> get(K key)
      returns a mutable set of values connected to the key; if no value is connected, returns an immutable empty set
      Parameters:
      key - key
      Returns:
      the set of values connected with the key
    • keySet

      public Set<K> keySet()
      Returns:
      the set of keys
    • getAllValues

      public Set<V> getAllValues()
      Returns:
      all values in the map
    • remove

      public boolean remove(K key)
      removes the set of values connected to the key
      Parameters:
      key - key
      Returns:
      true if changes made
    • remove

      public boolean remove(K key, V value)
      removes the value connected to the key; if there is more than one value connected to the key, only one is removed
      Parameters:
      key - key
      value - value
      Returns:
      true if changes made
    • size

      public int size()
      Returns:
      the size of the multimap (sum of all the sizes of the sets)
    • contains

      public boolean contains(K k, V v)
      Parameters:
      k - key
      v - value
      Returns:
      true if the pairing (k, v) is in the map (set equality for v)
    • containsKey

      public boolean containsKey(K k)
      Parameters:
      k - key
      Returns:
      true if k is a key for the map
    • containsValue

      public boolean containsValue(V v)
      Parameters:
      v - value
      Returns:
      true if v is a value for a key in the map
    • clear

      public void clear()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • putAll

      public void putAll(IdentityMultiMap<K,V> otherMap)
      Parameters:
      otherMap - map to copy from
    • putAll

      public void putAll(K k, Collection<V> v)
      Parameters:
      k - k
      v - v
    • isValueSetsEqual

      public boolean isValueSetsEqual()
      Returns:
      true if duplicate value sets