Package it.unimi.di.prog2.h15
package it.unimi.di.prog2.h15
Codice relativo alla lezione 15 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 Lisokv's parlance) on non zero digits; the variants correspond to various possibilities with regard to the implementation style of the generator:
DecimalDigitsEG
based on the external classNonZeroDigitsGenerator
,DecimalDigitsNSG
based on a nested static class,DecimalDigitsIG
based on an inner class,DecimalDigitsAG
based on an anonymous class.
-
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
NonZeroDigitsGenerator
class.A class representing decimal digits of a long, endowed with a non zero digits iterator, based on the innerNonZeroDigitsGeneratorIG
classA class representing decimal digits of a long, endowed with a non zero digits iterator, based on the nested staticNonZeroDigitsGeneratorNS
class.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.