java.lang.Object | |
↳ | com.google.gwt.benchmarks.client.impl.PermutationIterator |
Iterates over all the possible permutations available in a list of Iterable Iterables.
The simplest way to iterate over the permutations of multiple iterators is in a nested for loop. The PermutationIterator turns that for loop inside out into a single iterator, which enables you to access each permutation in a piecemeal fashion.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PermutationIterator.Permutation | A single permutation of all the iterators. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new PermutationIterator that provides the values for each
possible permutation of
iterables . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a new
Permutation containing the values of the next
permutation. | |||||||||||
Skips the remaining set of values in the bottom
Iterable . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Iterator
|
Constructs a new PermutationIterator that provides the values for each
possible permutation of iterables
.
iterables | non-null. Each Iterable must have at least one
element. iterables.size() must be > 1
TODO(tobyr) Consider if empty Iterables ever make sense in the context of
permutations.
|
---|
Returns a new Permutation
containing the values of the next
permutation.
Permutation
Skips the remaining set of values in the bottom Iterable
. This
method affects the results of both hasNext() and next().