Package randoop.util
Interface IMultiMap<K,V>
-
- All Known Implementing Classes:
CheckpointingMultiMap
,MultiMap
,MultiMap.EmptyMultiMap
public interface IMultiMap<K,V>
A multimap, which maps each key to a set of values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
add(K key, V value)
Precondition: the mapping key→value is not already in the map.Set<V>
getValues(K key)
Returns the values that the given key maps to.Set<K>
keySet()
Returns the set of keys in this map (the domain).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.
-
-
-
Method Detail
-
add
boolean add(K key, V value)
Precondition: the mapping key→value is not already in the map.- Parameters:
key
- cannot be nullvalue
- cannot be null- Returns:
- true if the call modifies this object
-
remove
boolean remove(K key, V value)
Precondition: the mapping key→value is in the map.- Parameters:
key
- cannot be nullvalue
- cannot be null- Returns:
- true if the call modifies this object
-
getValues
Set<V> getValues(K key)
Returns the values that the given key maps to.- Parameters:
key
- cannot be null- Returns:
- the set of values for the given key
-
keySet
Set<K> keySet()
Returns the set of keys in this map (the domain).- Returns:
- the set of keys in this map
-
size
int size()
Returns the size of this map: the number of mappings.- Returns:
- the number of entries in this map
-
-