|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjparfor.MultiThreader
public final class MultiThreader
MultiThreader providing foreach functions enabling parallel computations of the content of for loops.
Method Summary | ||
---|---|---|
static
|
foreach(java.lang.Iterable<I> inputs,
Functor<I,R> functor)
Execute the functor on all inputs. |
|
static
|
foreach(java.lang.Iterable<I> inputs,
int concurrentSize,
Functor<I,R> functor)
Execute the functor on all inputs. |
|
static int |
getNumberOfAvailableProcessors()
Return the number of processors used by the multithreader. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <I,R> java.util.ArrayList<R> foreach(java.lang.Iterable<I> inputs, Functor<I,R> functor)
I
- Type of input to the functor.R
- Type of results from the functor.inputs
- Collection of inputs to send to the functor.functor
- Functor that will compute results from inputs.
public static <I,R> java.util.ArrayList<R> foreach(java.lang.Iterable<I> inputs, int concurrentSize, Functor<I,R> functor)
I
- Type of input to the functor.R
- Type of results from the functor.inputs
- Collection of inputs to send to the functor.concurrentSize
- Maximum number of inputs to process in a batch (if set to -1, all inputs will be computed at once).
The inputs are put in batches according to the order given by the iterator.functor
- Functor that will compute results from inputs.
public static int getNumberOfAvailableProcessors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |