uk.ac.liv.util
Class BaseNIterator

java.lang.Object
  extended byuk.ac.liv.util.BaseNIterator
All Implemented Interfaces:
java.util.Iterator

public class BaseNIterator
extends java.lang.Object
implements java.util.Iterator

An iterator that enumerates the base N representation of every non-negative integer that can be represented within the specified number of digits.

Version:
$Revision: 1.2 $
Author:
Steve Phelps

Field Summary
protected  int base
           
protected  int currentNumber
           
protected  int maximumNumber
           
protected  int numDigits
           
 
Constructor Summary
BaseNIterator(int base, int numDigits)
           
 
Method Summary
protected  int[] convert()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentNumber

protected int currentNumber

base

protected int base

numDigits

protected int numDigits

maximumNumber

protected int maximumNumber
Constructor Detail

BaseNIterator

public BaseNIterator(int base,
                     int numDigits)
Method Detail

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

convert

protected int[] convert()