DoubleDeltaRange
Contents
Motivation
Experience implementing the Iterable<T> and Iterator<T> interfaces.
Mistakes To Avoid
Warning: Do NOT Parallelize |
Investigate
- interface Iterable<T>
- interface Iterator<T>
Code to Implement
DoubleRange
To implement this class you will need to declare and initialize fields. You should NOT create a List<Double> and fill it with the necessary values. The iterator should produce each next value live.
class DoubleDeltaRange implements Iterable<Double>
class: | DoubleDeltaRange.java | |
methods: | constructor iterator() |
|
package: | iteration.doubledelta.group | |
source folder: | student/src/main/java |
constructor
method: public DoubleDeltaRange(double minInclusive, double maxExclusive, double delta)
(sequential implementation only)
iterator()
method: public Iterator<Double> iterator()
(sequential implementation only)
Although, you can create a named class, we encourage you to use this opportunity to create an instance of an anonymous class here.
Testing Your Solution
Correctness
class: | _DoubleDeltaRangeTestSuite.java | |
package: | iteration.doubledelta.group | |
source folder: | testing/src/test/java |