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

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

public class ChooseNIterator
extends Object
implements Iterator

Author:
kgajos Iterator that generates subsets of a given size from an underlying collection

Constructor Summary
ChooseNIterator(Collection c, int n)
           
 
Method Summary
 boolean hasNext()
           
static void main(String[] args)
           
 Object next()
           
 void remove()
          This iterator does not support the remove operation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChooseNIterator

public ChooseNIterator(Collection c,
                       int n)
Method Detail

remove

public void remove()
This iterator does not support the remove operation

Specified by:
remove in interface Iterator
See Also:
Iterator.remove()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

main

public static void main(String[] args)