daikon.asm
Class DSForest
Object
DSForest
public class DSForest
- extends Object
Implements a partition of distinct elements into disjoint
sets. Each set in the partition is represented as a tree.
The operation add(String t) add a new element t to the partition.
The operation union(String t1, T t2) unions the (possibly distinct) sets
containing t1 and t2.
The operation getSets() returns the sets of the partition.
This implementation has the additional requirement that all new
elements added to the partition must be non-equal, where equality
is determined according to the equals/hashCode methods. In other
words, if at some point the operation add(t) is performed for some
t, and t1.equals(t2), then attempting to perform add(t2) will
result in an IllegalArgumentException.
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DSForest
public DSForest()
add
public void add(String e)
- If e != null and is not already in the forest, adds e to the
forest. Otherwise throws an IllegalArgumentException.
union
public void union(String x,
String y)
- x and y must be elements of the forest. If e1.equals(e2), or e1
and e2 are already in the same set, has no effect. Otherwise,
unions the sets containing e1 and e2.
getSets
public Set<Set<String>> getSets()