edu.harvard.seas.iis.util.combinatorics
Class DistinctPairsIterator

java.lang.Object
  extended by edu.harvard.seas.iis.util.combinatorics.DistinctPairsIterator
All Implemented Interfaces:
java.util.Iterator

public class DistinctPairsIterator
extends java.lang.Object
implements java.util.Iterator

Author:
kgajos Generates distinct pairs out of a single collection of objects (if pair A,B is generated, then B,A won't be; it will never generate A,A either)

Constructor Summary
DistinctPairsIterator(java.util.Collection c)
           
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistinctPairsIterator

public DistinctPairsIterator(java.util.Collection c)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator