Package it.unimi.di.prog2.h14
Class IntGenerator
java.lang.Object
it.unimi.di.prog2.h14.IntGenerator
Generator (in Liskov parlance) of the ints contained in a
List
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionIntGenerator
(List<Integer> els) Builds an iterator (partial constructor, used just inIntSet
). -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
els
The list elements. -
idx
private int idxThe position of the next element to return (ifidx < els.size()
.
-
-
Constructor Details
-
IntGenerator
Builds an iterator (partial constructor, used just inIntSet
).- Parameters:
els
- the list of elements, must not be, or contain,null
.
-
-
Method Details