|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.util.Permutations<T>
T
- the element typepublic class Permutations<T>
A class to iterate over all permutations of an array. The algorithm is from Applied Combinatorics, by Alan Tucker as implemented in http://www.koders.com/java/fidD3445CD11B1DC687F6B8911075E7F01E23171553.aspx
Method Summary | ||
---|---|---|
static
|
create(T[] in,
T[] out)
Create a new permutations object. |
|
static
|
create(T[] in,
T[] out,
int m)
Create a new permutations object. |
|
boolean |
next()
Go to the next lineup, and if available, fill the target array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> Permutations<T> create(T[] in, T[] out)
T
- the typein
- the source arrayout
- the target array
public static <T> Permutations<T> create(T[] in, T[] out, int m)
T
- the typein
- the source arrayout
- the target arraym
- the number of output elements to generate
public boolean next()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |