de.tu_darmstadt.es.sopra.exercises Class UnionFind java.lang.Object extended by de.tu_darmstadt.es.sopra.exercises.Information extended by de.tu_darmstadt.es.sopra.exercises.UnionFind public abstract class UnionFind extends Information This is the abstract base class to implement a union-find structure. Version: 1.0 Author: Markus Schmidt Constructor Summary UnionFind() Method Summary abstract java.util.Collection find(java.lang.Object obj) Finds the partition the given object belongs to. abstract int getNrObjects() Returns the number of all objects inside the partitions. abstract int getNrPartitions() Returns the number partitions. abstract void makePartition(java.lang.Object obj) Creates a new partition with the given object. abstract void merge(java.lang.Object obj1, java.lang.Object obj2) Merges the partitions the given objects belong to into a new partition. Methods inherited from class de.tu_darmstadt.es.sopra.exercises.Information getAuthors, getTeam, getVersion Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructor Detail UnionFind public UnionFind() Method Detail makePartition public abstract void makePartition(java.lang.Object obj) Creates a new partition with the given object. Nothing happens, if the object is invalid (null). Parameters: obj - the object to put into a new partition Since: 27.09.2005 find public abstract java.util.Collection find(java.lang.Object obj) Finds the partition the given object belongs to. Parameters: obj - the object Returns: * null, if and only if the object is invalid (null) or not in any partition. * otherwise the partition containing the given object. Since: 27.09.2005 merge public abstract void merge(java.lang.Object obj1, java.lang.Object obj2) Merges the partitions the given objects belong to into a new partition. Nothing happens, if one object is invalid (null) or one object is not part of any partition. Parameters: obj1 - the first object obj2 - the second object Since: 27.09.2005 getNrObjects public abstract int getNrObjects() Returns the number of all objects inside the partitions. Returns: number of objects inside all partitions Since: 27.09.2005 getNrPartitions public abstract int getNrPartitions() Returns the number partitions. Returns: number of partitions Since: 27.09.2005