de.bezier.math.combinatorics
Class CombinatoricsBaseSet

java.lang.Object
  extended by de.bezier.math.combinatorics.CombinatoricsBase
      extended by de.bezier.math.combinatorics.CombinatoricsBaseSet
Direct Known Subclasses:
CombinationSet, VariationSet

public abstract class CombinatoricsBaseSet
extends CombinatoricsBase

Base class for all sets of CombinatoricsBases. Used for CombinationSet and VariationSet

A set means a group of. For example CombinationSet will represent a group of Combinations, ..

You should not need to use this class on it's own ..


Constructor Summary
CombinatoricsBaseSet(int elements)
          Same as using new CombinatoricsBaseSet( elements, 0, elements )
CombinatoricsBaseSet(int elements, int from, int to)
          See intro to CombinationSet for an explaination.
 
Method Summary
 boolean hasMore()
          Check to see if there are more results available to be read, for example:
 int[] next()
          Read next result (if there is one) and update internal counter.
 
Methods inherited from class de.bezier.math.combinatorics.CombinatoricsBase
nextAndStep, numberOfElements, position, positionAsInt, positionAsLong, positionInPercent, positionInPercent, rewind, total, totalAsInt, totalAsLong
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinatoricsBaseSet

public CombinatoricsBaseSet(int elements)
Same as using new CombinatoricsBaseSet( elements, 0, elements )


CombinatoricsBaseSet

public CombinatoricsBaseSet(int elements,
                            int from,
                            int to)
See intro to CombinationSet for an explaination.

Parameters:
elements - Number of elements each CombinatoricsBase in this set should represent
from - Length of smallest: CombinatoricsBase( elements, from )
to - Length of largest included: CombinatoricsBase( elements, to )
See Also:
CombinationSet
Method Detail

hasMore

public boolean hasMore()
Check to see if there are more results available to be read, for example:
        while ( cset.hasMore() )
        {
                int res[] = cset.next();
                // do something extraordinary with it here ..
        }
        

Specified by:
hasMore in class CombinatoricsBase
Returns:
true if there are more results to be read, false otherwise

next

public int[] next()
Read next result (if there is one) and update internal counter.

Specified by:
next in class CombinatoricsBase
Returns:
A result in form of an array of indices, see Combination intro for explaination
See Also:
CombinationSet


processing library Combinatorics by Florian Jenett. (c) 2010-2011