public final class ParallelMapping<I,O> extends Object implements Iterable<O>
Iterable
,
this Iterable
will apply a function to each input ahead of consumption
in a pool of threads managed by an ExecutorService
.
Does not hold onto the head of the input sequence.
The sequence can be consumed only once, i.e. only a single call to iterator()
is possible.
This class ought to be an Iterator
rather than an Iterable
,
but it is an Iterable
for convenience, so that the for loop construct works.Constructor and Description |
---|
ParallelMapping(int n_proc,
Iterable<I> inputs,
TaskFactory<I,O> generator) |
ParallelMapping(int n_proc,
Iterator<I> inputs,
TaskFactory<I,O> generator) |
ParallelMapping(Iterable<I> inputs,
TaskFactory<I,O> generator) |
ParallelMapping(Iterator<I> inputs,
TaskFactory<I,O> generator) |
Modifier and Type | Method and Description |
---|---|
Iterator<O> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ParallelMapping(Iterable<I> inputs, TaskFactory<I,O> generator)
public ParallelMapping(Iterator<I> inputs, TaskFactory<I,O> generator)
public ParallelMapping(int n_proc, Iterable<I> inputs, TaskFactory<I,O> generator)
Copyright © 2015–2021 Fiji. All rights reserved.