randoop.util
Class ReversibleMultiMap<T1,T2>

Object
  extended by ReversibleMultiMap<T1,T2>
All Implemented Interfaces:
IMultiMap<T1,T2>

public class ReversibleMultiMap<T1,T2>
extends Object
implements IMultiMap<T1,T2>


Field Summary
Modifier and Type Field and Description
 List<Integer> marks
           
static boolean verbose_log
           
 
Constructor Summary
Constructor and Description
ReversibleMultiMap()
           
 
Method Summary
Modifier and Type Method and Description
 void add(T1 key, T2 value)
          Precondition: the mapping key->value is not already in the map.
 Set<T2> getValues(T1 key)
          Returns the values that the given key maps to.
 Set<T1> keySet()
          Returns the set of keys in this map (the domain).
 void mark()
           
 void remove(T1 key, T2 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.
 void undoToLastMark()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

verbose_log

public static boolean verbose_log

marks

public final List<Integer> marks
Constructor Detail

ReversibleMultiMap

public ReversibleMultiMap()
Method Detail

add

public void add(T1 key,
                T2 value)
Description copied from interface: IMultiMap
Precondition: the mapping key->value is not already in the map.

Specified by:
add in interface IMultiMap<T1,T2>
Parameters:
key - cannot be null.
value - cannot be null.

remove

public void remove(T1 key,
                   T2 value)
Description copied from interface: IMultiMap
Precondition: the mapping key->value is in the map.

Specified by:
remove in interface IMultiMap<T1,T2>
Parameters:
key - cannot be null.
value - cannot be null.

mark

public void mark()

undoToLastMark

public void undoToLastMark()

getValues

public Set<T2> getValues(T1 key)
Description copied from interface: IMultiMap
Returns the values that the given key maps to.

Specified by:
getValues in interface IMultiMap<T1,T2>
Parameters:
key - cannot be null.

keySet

public Set<T1> keySet()
Description copied from interface: IMultiMap
Returns the set of keys in this map (the domain).

Specified by:
keySet in interface IMultiMap<T1,T2>

size

public int size()
Description copied from interface: IMultiMap
Returns the size of this map: the number of mappings.

Specified by:
size in interface IMultiMap<T1,T2>

toString

public String toString()
Description copied from interface: IMultiMap
Returns a String representation of this map.

Specified by:
toString in interface IMultiMap<T1,T2>
Overrides:
toString in class Object