|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjwutil.math.CombinationGenerator
public class CombinationGenerator
Generates combinations.
| Constructor Summary | |
|---|---|
CombinationGenerator(int n,
int r)
Create a new combination generator. |
|
| Method Summary | |
|---|---|
int[] |
getCurrent()
Returns the current combination. |
int[] |
getNext()
Generate next combination (algorithm from Rosen p. |
java.math.BigInteger |
getNumLeft()
Return number of combinations not yet generated. |
java.math.BigInteger |
getTotal()
Return total number of combinations. |
boolean |
hasMore()
Are there more combinations? |
void |
reset()
Reset this combination generator back to the start. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CombinationGenerator(int n,
int r)
n - size of universer - number of elements to choose| Method Detail |
|---|
public void reset()
public java.math.BigInteger getNumLeft()
public boolean hasMore()
public java.math.BigInteger getTotal()
public int[] getCurrent()
public int[] getNext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||