Package randoop.util
Class MultiMap.EmptyMultiMap<K extends @Signed Object,V extends @Signed Object>
- java.lang.Object
-
- randoop.util.MultiMap<K,V>
-
- randoop.util.MultiMap.EmptyMultiMap<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description static MultiMap.EmptyMultiMap
instance
The canonical EmptyMultiMap.
-
Constructor Summary
Constructors Modifier Constructor Description private
EmptyMultiMap()
Creates an immutable, empty multimap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(K key, V value)
Precondition: the mapping key→value is not already in the map.void
addAll(Map<? extends K,? extends V> m)
void
addAll(K key, Collection<? extends V> values)
void
addAll(MultiMap<K,V> mmap)
void
clear()
boolean
contains(K obj)
Set<V>
getValues(K key)
Returns the values that the given key maps to.boolean
isEmpty()
Set<K>
keySet()
Returns the set of keys in this map (the domain).void
put(K key, Collection<? extends V> values)
Adds a key-values mapping to this multimap.boolean
remove(K key)
boolean
remove(K key, V value)
Precondition: the mapping key→value is in the map.int
size()
Returns the size of this map: the number of mappings.String
toString()
Returns a String representation of this map.
-
-
-
Field Detail
-
instance
public static MultiMap.EmptyMultiMap instance
The canonical EmptyMultiMap.
-
-
Method Detail
-
put
public void put(K key, Collection<? extends V> values)
Description copied from class:MultiMap
Adds a key-values mapping to this multimap.
-
addAll
public void addAll(K key, Collection<? extends V> values)
-
add
public boolean add(K key, V value)
Description copied from interface:IMultiMap
Precondition: the mapping key→value is not already in the map.
-
remove
public boolean remove(K key, V value)
Description copied from interface:IMultiMap
Precondition: the mapping key→value is in the map.
-
remove
public boolean remove(K key)
-
getValues
public Set<V> getValues(K key)
Description copied from interface:IMultiMap
Returns the values that the given key maps to.
-
keySet
public Set<K> keySet()
Description copied from interface:IMultiMap
Returns the set of keys in this map (the domain).
-
contains
public boolean contains(K obj)
-
clear
public void clear()
-
size
public int size()
Description copied from interface:IMultiMap
Returns the size of this map: the number of mappings.
-
isEmpty
public boolean isEmpty()
-
-