SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.grid.executor

Interface GridExecutor

• Method Summary

All Methods
Modifier and Type Method and Description
<O> List<O> forLoop(int start, int end, Function<O,Integer> f)
Runs a for-loop over the given range of integers, using an increment of 1.
<O> List<O> forLoop(int start, int end, int increment, Function<O,Integer> f)
Runs a for-loop over the given range of integers, using the given increment.
<O,I> List<O> map(List<I> xs, Function<? extends O,? super I> f)
Performs the 'map' operation from functional programming, applying the given function f to each element in the input collection.
void shutdown()
Shuts down the executor gracefully.
• Method Detail

• shutdown

void shutdown()
Shuts down the executor gracefully. Calling this method will cause the JVM to reclaim resources from this executor.
• map

<O,I> List<O> map(List<I> xs,
Function<? extends O,? super I> f)
Performs the 'map' operation from functional programming, applying the given function f to each element in the input collection.

The output collection will contain, for each input element, an output element at the same index, which is the result to applying f to it.

Type Parameters:
O - the type of the output
I - the type of the input
Parameters:
xs - the input collection
f - the function to be applied to each element in the input collection
Returns:
the result of the map operation
• forLoop

<O> List<O> forLoop(int start,
int end,
Function<O,Integer> f)
Runs a for-loop over the given range of integers, using an increment of 1.
Type Parameters:
O - the type of the output
Parameters:
start - the start of the range of the for-loop, inclusive
end - the end of the range of the for-loop, exclusive
f - the function to be run at each step of the for loop
Returns:
the result of applying the given function to each index
• forLoop

<O> List<O> forLoop(int start,
int end,
int increment,
Function<O,Integer> f)
Runs a for-loop over the given range of integers, using the given increment.
Type Parameters:
O - the type of the output
Parameters:
start - the start of the range of the for-loop, inclusive
end - the end of the range of the for-loop, exclusive
increment - the increment between successive steps of the for loop
f - the function to be run at each step of the for loop
Returns:
the result of applying the given function to each index