Package it.unimi.di.prog2.h14
package it.unimi.di.prog2.h14
Materiale relativo alla lezione 14 per maggiori dettagli si veda il diario del corso.
In this package there are several variants of a DecimalDigits, a class that can be
used to compute the digits of the decimal expansion of a given number.
All the variants are endowed in addition with an iterator (that is a method that returns a generator in Liskov's parlance) on non zero digits; the variants correspond to various possibilities with regard to the implementation style of the generator:
DecimalDigitsEGbased on the external classNonZeroDigitsGenerator,DecimalDigitsNSGbased on a nested static class,DecimalDigitsIGbased on an inner class,DecimalDigitsAGbased on an anonymous class.
Such variants are listed in increasing order of preferableness (and implementation complexity).
-
ClassesClassDescriptionA class representing decimal digits of a long.A class representing decimal digits of a long, endowed with a non zero digits iterator, based on an anonymous class.A class representing decimal digits of a long, endowed with a non zero digits iterator, based on the external
NonZeroDigitsGeneratorclass.A class representing decimal digits of a long, endowed with a non zero digits iterator, based on the innerNonZeroDigitsGeneratorIGclass.A class representing decimal digits of a long, endowed with a non zero digits iterator, based on the nested staticNonZeroDigitsGeneratorNSclass.A nested static class implementing the genrator.A generator returning the non zero digits of a long from the least to the most significant one.A class to collect a sequence of strings and format them.