Class NonZeroDigitsGenerator

java.lang.Object
it.unimi.di.prog2.h15.NonZeroDigitsGenerator
All Implemented Interfaces:
Iterator<Integer>

public class NonZeroDigitsGenerator extends Object implements Iterator<Integer>
A generator returning the non zero digits of a long from the least to the most significant one.
  • Field Details

    • remaining

      private long remaining
      The remaining digits to return (except possibly for the trailing zeroes).
  • Constructor Details

    • NonZeroDigitsGenerator

      protected NonZeroDigitsGenerator(long number)
      Creates a new generator for the given number.
      Parameters:
      number - the number.
  • Method Details