|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.util.PermutationGenerator
public class PermutationGenerator extends java.lang.Object
Systematically generate permutations. Adapted from Java Code by Michael Gilleland (released with no restrictions) using an algorithm described here: Kenneth H. Rosen, Discrete Mathematics and Its Applications, 2nd edition (NY: McGraw-Hill, 1991), pp. 282-284
Constructor Summary | |
PermutationGenerator(java.util.Collection items)
WARNING: Don't make n too large. |
Method Summary | |
---|---|
java.math.BigInteger
|
getTotal()
|
boolean
|
hasNext()
|
java.util.List
|
next()
Generate next permutation (algorithm from Rosen p. 284) |
void
|
remove()
|
void
|
reset()
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public PermutationGenerator(java.util.Collection items)
items
- the items to permute
Method Detail |
---|
public java.math.BigInteger getTotal()
public boolean hasNext()
public java.util.List next()
public void remove()
public void reset()
Groovy Documentation