Class CombinationIterator<T>
java.lang.Object
org.plumelib.util.CombinationIterator<T>
- Type Parameters:
T- the type of the elements of the collections
Given a set of collections, yield each combination that takes one element from each collection.
Each tuple has a value from each candidate list. Each combination'slength is the same as the
number of input lists.
For instance, given [["a1", "a2"], ["b1"], ["c1", "c2", "c3"]], this class yields in
turn:
["a1", "b1", "c1"] ["a1", "b1", "c2"] ["a1", "b1", "c3"] ["a2", "b1", "c1"] ["a2", "b1", "c2"] ["a2", "b1", "c3"]
-
Constructor Summary
ConstructorsConstructorDescriptionCombinationIterator(Collection<? extends Collection<T>> collectionsOfCandidates) Creates aCombinationIteratorfor lists constructed from the given candidates. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
CombinationIterator
Creates aCombinationIteratorfor lists constructed from the given candidates. Each generated list will be the same length as the given list.- Parameters:
collectionsOfCandidates- lists of candidate values for each position in generated lists
-
-
Method Details
-
hasNext
-
next
-
remove
-