|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.bezier.math.combinatorics.CombinatoricsBase
de.bezier.math.combinatorics.Variation
public class Variation
Like a counter, duplications, order counts
A Variation represents all possible variations of a given set of elements. This includes duplications ("a,a,a" is OK) and the order is important ("a,b" is not "b,a" and each is counted).
Constructor Summary | |
---|---|
Variation(int elements)
Same as using Variation( elements, elements ) |
|
Variation(int elements,
int length)
|
Method Summary | |
---|---|
boolean |
hasMore()
Check if there are more results available to be read. |
int[] |
next()
Return next result and update internal counter. |
void |
rewind()
Rewind, start over, reset, recycle. |
Methods inherited from class de.bezier.math.combinatorics.CombinatoricsBase |
---|
nextAndStep, numberOfElements, position, positionAsInt, positionAsLong, positionInPercent, positionInPercent, total, totalAsInt, totalAsLong |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Variation(int elements)
public Variation(int elements, int length)
elements
- Number of elements to return variations for, should be larger than 0length
- Length of the results (arrays of indices) to return, should not be negativeMethod Detail |
---|
public void rewind()
CombinatoricsBase
rewind
in class CombinatoricsBase
public boolean hasMore()
CombinatoricsBase
hasMore
in class CombinatoricsBase
public int[] next()
CombinatoricsBase
next
in class CombinatoricsBase
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |