com.sun.electric.tool.ncc.basic
Class TransitiveRelation<T>

java.lang.Object
  extended by com.sun.electric.tool.ncc.basic.TransitiveRelation<T>

public class TransitiveRelation<T>
extends java.lang.Object

The TransitiveRelation object is given pairs of objects that are related. Relationship is presumed to be transitive. The TransitiveRelation object can then return maximal sets of related objects. For example, if Tom is related to Sally, John is related to Tom, and Fred is related to Paul then TransitiveRelation returns {Tom, Sally, John} and {Fred, Paul}.


Constructor Summary
TransitiveRelation()
           
 
Method Summary
 java.util.Iterator<java.util.Set<T>> getSetsOfRelatives()
          Return an Iterator over Sets of related Objects.
 void theseAreRelated(T o1, T o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransitiveRelation

public TransitiveRelation()
Method Detail

theseAreRelated

public void theseAreRelated(T o1,
                            T o2)

getSetsOfRelatives

public java.util.Iterator<java.util.Set<T>> getSetsOfRelatives()
Return an Iterator over Sets of related Objects.