randoop.util
Class ReversibleSet<T>

Object
  extended by ReversibleSet<T>
All Implemented Interfaces:
ISimpleSet<T>

public class ReversibleSet<T>
extends Object
implements ISimpleSet<T>


Field Summary
Modifier and Type Field and Description
 ReversibleMultiMap<T,Boolean> map
           
 
Constructor Summary
Constructor and Description
ReversibleSet()
           
 
Method Summary
Modifier and Type Method and Description
 void add(T elt)
          Adds the given elt to the set.
 boolean contains(T elt)
          Returns true if elt is in this set.
 Set<T> getElements()
          Returns the elements in this set, as a java.util.Set
 void mark()
           
 void remove(T elt)
          Removes the given elt from the set.
 int size()
          Returns the size of this set.
 String toString()
          Returns a String representation of this set.
 void undoToLastMark()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

public final ReversibleMultiMap<T,Boolean> map
Constructor Detail

ReversibleSet

public ReversibleSet()
Method Detail

add

public void add(T elt)
Description copied from interface: ISimpleSet
Adds the given elt to the set. Precondition: the given elt is not already in the set.

Specified by:
add in interface ISimpleSet<T>
Parameters:
elt - cannot be null.

contains

public boolean contains(T elt)
Description copied from interface: ISimpleSet
Returns true if elt is in this set.

Specified by:
contains in interface ISimpleSet<T>
Parameters:
elt - cannot be null.

getElements

public Set<T> getElements()
Description copied from interface: ISimpleSet
Returns the elements in this set, as a java.util.Set

Specified by:
getElements in interface ISimpleSet<T>

remove

public void remove(T elt)
Description copied from interface: ISimpleSet
Removes the given elt from the set. Precondition: the given elt is in the set.

Specified by:
remove in interface ISimpleSet<T>
Parameters:
elt - cannot be null.

size

public int size()
Description copied from interface: ISimpleSet
Returns the size of this set.

Specified by:
size in interface ISimpleSet<T>

mark

public void mark()

undoToLastMark

public void undoToLastMark()

toString

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

Specified by:
toString in interface ISimpleSet<T>
Overrides:
toString in class Object