public interface Framework extends AutoCloseable
To see how a framework is used, take a look at
Like FinishContext, this is an interface, describing methods that several
classes have. You will be writing the default forAll and forAllChunked
methods here, but do not modify this file until you have gotten to Part 3D.
When you get here, you can test the methods with
|Modifier and Type||Method and Description|
Closes this framework.
Runs the given body and wait for all asyncs to finish.
Should spawn an asyncronous task for each element in iterable and wait for all of them to finish.
Should chunk the given range and run the body on each value.
void finish(Consumer<FinishContext> body)
body- the body of this finish
FinishContext.forAsync(Iterable, Consumer)except that it blocks until all iterations have finished. Your implementation should use the forAsync method.
E- the type of element used with each iteration
iterable- the iterable with the values to go through
body- the function to run on each iteration
default void forAllChunked(int min, int max, IntConsumer body)
Slice) should run in parallel, but within each chunk, the IntConsumer bodies should be run sequentially. Your implementation should make use of your