Package it.unimi.di.prog2.h15
Class DecimalDigitsAG
java.lang.Object
it.unimi.di.prog2.h15.DecimalDigitsAG
A class representing decimal digits of a long, endowed with a non zero digits iterator, based on
an anonymous class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
The number whose digits are represented by this class. -
Constructor Summary
ConstructorsConstructorDescriptionDecimalDigitsAG
(long number) Creates a new instance representing the digits of the given number. -
Method Summary
Modifier and TypeMethodDescriptionReturns a generator on from the least significant to the most significant non zero digits.
-
Field Details
-
number
private final long numberThe number whose digits are represented by this class.
-
-
Constructor Details
-
DecimalDigitsAG
public DecimalDigitsAG(long number) Creates a new instance representing the digits of the given number.- Parameters:
number
- the number.
-
-
Method Details
-
nonZeroDigits
Returns a generator on from the least significant to the most significant non zero digits.- Returns:
- the generator.
-