com.ibm.wala.util.collections
Class HashSetMultiMap<K,V>

java.lang.Object
  extended by com.ibm.wala.util.collections.HashSetMultiMap<K,V>
All Implemented Interfaces:
MultiMap<K,V>

public class HashSetMultiMap<K,V>
extends java.lang.Object


Field Summary
protected  boolean create
           
protected  java.util.Map<K,java.util.Set<V>> map
           
 
Constructor Summary
HashSetMultiMap()
           
HashSetMultiMap(boolean create)
           
 
Method Summary
 void clear()
           
 boolean containsKey(K key)
           
protected  java.util.Set<V> createSet()
           
protected  java.util.Set<V> emptySet()
           
 java.util.Set<V> get(K key)
           
 boolean isEmpty()
           
 java.util.Set<K> keySet()
           
static
<K,V> HashSetMultiMap<K,V>
make()
           
 boolean put(K key, V val)
           
 boolean putAll(K key, java.util.Collection<? extends V> vals)
           
 boolean remove(K key, V val)
           
 java.util.Set<V> removeAll(K key)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected final java.util.Map<K,java.util.Set<V>> map

create

protected final boolean create
Constructor Detail

HashSetMultiMap

public HashSetMultiMap()

HashSetMultiMap

public HashSetMultiMap(boolean create)
Method Detail

createSet

protected java.util.Set<V> createSet()

make

public static <K,V> HashSetMultiMap<K,V> make()

emptySet

protected java.util.Set<V> emptySet()

get

public java.util.Set<V> get(K key)
Specified by:
get in interface MultiMap<K,V>

put

public boolean put(K key,
                   V val)
Specified by:
put in interface MultiMap<K,V>

remove

public boolean remove(K key,
                      V val)
Specified by:
remove in interface MultiMap<K,V>

removeAll

public java.util.Set<V> removeAll(K key)
Specified by:
removeAll in interface MultiMap<K,V>

keySet

public java.util.Set<K> keySet()
Specified by:
keySet in interface MultiMap<K,V>

containsKey

public boolean containsKey(K key)
Specified by:
containsKey in interface MultiMap<K,V>

size

public int size()
Specified by:
size in interface MultiMap<K,V>

toString

public java.lang.String toString()
Specified by:
toString in interface MultiMap<K,V>
Overrides:
toString in class java.lang.Object

putAll

public boolean putAll(K key,
                      java.util.Collection<? extends V> vals)
Specified by:
putAll in interface MultiMap<K,V>

clear

public void clear()
Specified by:
clear in interface MultiMap<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface MultiMap<K,V>