Difference between revisions of "DoubleDeltaRange"

From CSE231 Wiki
Jump to navigation Jump to search
m (Cosgroved moved page DoubleRange to DoubleDeltaRange)
Line 9: Line 9:
 
* interface [https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html Iterator<T>]
 
* interface [https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html Iterator<T>]
  
<youtube>Dww-_5EiwA8</youtube>
+
<youtube>4ycpqdJ4yb4</youtube>
  
 
=Code to Implement=
 
=Code to Implement=

Revision as of 09:45, 30 January 2022

Motivation

Experience implementing the Iterable<T> and Iterator<T> interfaces.

Mistakes To Avoid

Attention niels epting.svg Warning: Do NOT Parallelize

Investigate

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 Java.png
methods: constructor
iterator()
package: iteration.doubledelta.group
source folder: student/src/main/java

constructor

method: public DoubleDeltaRange(double minInclusive, double maxExclusive, double delta) Sequential.svg (sequential implementation only)

iterator()

method: public Iterator<Double> iterator() Sequential.svg (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 Junit.png
package: iteration.doubledelta.group
source folder: testing/src/test/java