edu.harvard.seas.iis.util.combinatorics
Class ChooseNIterator
java.lang.Object
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
ChooseNIterator
public ChooseNIterator(Collection c,
int n)
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)