com.espertech.esper.collection
Class NumberAscCombinationEnumeration

java.lang.Object
  extended by com.espertech.esper.collection.NumberAscCombinationEnumeration
All Implemented Interfaces:
java.util.Enumeration<int[]>

public class NumberAscCombinationEnumeration
extends java.lang.Object
implements java.util.Enumeration<int[]>

Provides an enumeration of each combination of numbers between zero and N-1 with N must be at least 1, with each combination cannot have duplicates, with each combination at least one element, with the longest combination gets returned first and the least long combination of the highest N-1 value last.

For example, for N=3:

         {0, 1, 2}
         {0, 1}
         {0, 2}
         {1, 2}
         {0}
         {1}
         {2}
     


Constructor Summary
NumberAscCombinationEnumeration(int n)
           
 
Method Summary
 boolean hasMoreElements()
           
 int[] nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberAscCombinationEnumeration

public NumberAscCombinationEnumeration(int n)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration<int[]>

nextElement

public int[] nextElement()
Specified by:
nextElement in interface java.util.Enumeration<int[]>

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com