Difference between revisions of "Fork Loop Assignment"

From CSE231 Wiki
Jump to navigation Jump to search
Line 15: Line 15:
  
 
for each text in parallel, produce <code>text + " " + text</code>.
 
for each text in parallel, produce <code>text + " " + text</code>.
 +
 +
<code>toEchoes</code> accepts a [https://docs.oracle.com/javase/8/docs/api/java/util/List.html List] parameter and returns a [https://docs.oracle.com/javase/8/docs/api/java/util/List.html List].
  
 
===client===
 
===client===

Revision as of 02:36, 29 January 2023

Motivation

There are many incantations of the fork_loop. We gain experience with selecting the right one for two scenarios.

Code To Use

FJ<E>

class FJ<E>

join_fork_loop(returnValueComponentType, array, function)
join_fork_loop(iterable, function)

Echoes

class: Echoes.java Java.png
methods: toEchoes
package: forkloop.group
source folder: student/src/main/java

toEchoes

method: public static List<String> toEchoes(List<String> texts) Parallel.svg (parallel implementation required)

for each text in parallel, produce text + " " + text.

toEchoes accepts a List parameter and returns a List.

client

class: EchoClient.java DEMO: Java.png
methods: main
package: forkloop.client
source folder: src/main/java

Code To Implement

SquareRoots

class: SquareRoots.java Java.png
methods: toSquareRoots
package: forkloop.group
source folder: student/src/main/java

toSquareRoots

method: public static Double[] toSquareRoots(Double[] values) Parallel.svg (parallel implementation required)

client

class: SquareRootClient.java DEMO: Java.png
methods: main
package: forkloop.client
source folder: src/main/java

Testing

class: _ForkLoopTestSuite.java Junit.png
package: forkloop.group
source folder: testing/src/test/java