Class PermutationIterator<T>
java.lang.Object
net.sf.colossus.util.PermutationIterator<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPermutationIterator(List<T> list) Set up a permutation generator for the passed list. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()hasNext should not change things if called repeatedly, so when it's called we'll lazily evaluate the next permutation, and then keep returning true until next() is called.next()voidremove()private voidswap(int lower) Swap elements lower and lower + 1 of permListMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Field Details
-
permList
-
pg
-
foundNext
private boolean foundNext -
anyLeft
private boolean anyLeft -
first
private boolean first -
nextSwap
private int nextSwap
-
-
Constructor Details
-
PermutationIterator
-
-
Method Details
-
hasNext
-
next
-
remove
-
swap
private void swap(int lower) Swap elements lower and lower + 1 of permList
-