|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.ac.ua.broker.utils.CombinationGenerator
public class CombinationGenerator
This class is used to systematically generate the next possible combination when it is needed, this utility class is needed because it is impossible to store a very large number of combinations in memory at once.
Constructor Summary | |
---|---|
CombinationGenerator(int n,
int r)
Constructor for CombinationGenerator |
Method Summary | |
---|---|
int[] |
getCurrent()
|
int[] |
getNext()
Generate next combination (algorithm from Rosen p. |
java.math.BigInteger |
getNumLeft()
|
java.math.BigInteger |
getTotal()
|
boolean |
hasMore()
|
void |
reset()
Reset the combination generator, start iterating again from the first combination possible. |
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
- number of possible integersr
- size of one combinationMethod Detail |
---|
public void reset()
public java.math.BigInteger getNumLeft()
public boolean hasMore()
public java.math.BigInteger getTotal()
public int[] getNext()
public int[] getCurrent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |