net.ericaro.neoitertools.generators.combinatorics
Class BigNumber

java.lang.Object
  extended by net.ericaro.neoitertools.generators.combinatorics.BigNumber
All Implemented Interfaces:
Generator<int[]>
Direct Known Subclasses:
CombinationNumber, FactorialNumber, FixedSumNumber, VarBaseNumber

public abstract class BigNumber
extends java.lang.Object
implements Generator<int[]>

A BigNumber is simply a number represented by a fixed collections of digits of size size. it requires two abstract method : inc() to move to the next one.

Author:
eric
See Also:
BigNumber's wiki page, neoitertools site

Field Summary
protected  int[] base
           
protected  int size
           
 
Constructor Summary
BigNumber(int size)
           
 
Method Summary
protected abstract  void inc()
          increment this big number by one
 int[] next()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

base

protected int[] base

size

protected int size
Constructor Detail

BigNumber

public BigNumber(int size)
Method Detail

inc

protected abstract void inc()
                     throws java.util.NoSuchElementException
increment this big number by one

Throws:
java.util.NoSuchElementException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

next

public int[] next()
Specified by:
next in interface Generator<int[]>
Returns:
the next item in the sequence.


Copyright © 2011. All Rights Reserved.