Difference between revisions of "PowersOf2Iterable"

From CSE231 Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
=Investigate=
 
=Investigate=
 
[https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html interface Iterable<T>]
 
[https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html interface Iterable<T>]
 +
 
[https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html interface Iterator<T>]
 
[https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html interface Iterator<T>]
  

Revision as of 04:15, 18 January 2020

Motivation

Experience with implementing interfaces.

Investigate

interface Iterable<T>

interface Iterator<T>

Mistakes To Avoid

Attention niels epting.svg Warning: Do NOT Parallelize

Code to Implement

class: PowersOfTwoLessThan.java Java.png
methods: constructor
iterator
package: slices.studio
source folder: student/src/main/java

constructor

method: public PowersOfTwoLessThan(int maxExclusive) Sequential.svg (sequential implementation only)

iterator

method: public Iterator<Integer> iterator() Sequential.svg (sequential implementation only)

Testing Your Solution

Correctness

class: PowersOfTwoTestSuite.java Junit.png
package: powersoftwo.studio
source folder: testing/src/test/java