|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.operation.foreach.ForEach<E,V>
E - elementsV - result valuespublic class ForEach<E,V>
A ForEach will iterate over a given Iterable instance and executes a given List of Operations.
Operation,
Iterable| Nested Class Summary | |
|---|---|
static class |
ForEach.Result<V>
ForEach.Result of a ForEach Operation which is basically an unmodifiable List of all returned
instances from the Operations. |
| Constructor Summary | |
|---|---|
ForEach(Iterable<E>... iterables)
|
|
ForEach(Iterable<E> iterable)
|
|
| Method Summary | ||
|---|---|---|
ForEach<E,V> |
doExecuteInParallelUsing(ExecutorService executorService)
|
|
ForEach<E,V> |
doIterateInParallelUsing(ExecutorService executorService,
int numberOfThreads)
If this option is used, the given Iterables have to have threadsafe Iterable.iterator() instances, since even
the Iterators will be called from parallel running threads. |
|
|
execute(CollectionUtils.CollectionConverter<O,V> collectionConverter,
Operation<O,E>... operations)
Executes the given Operation and uses the given CollectionUtils.CollectionConverter to produce a single result value |
|
ForEach.Result<V> |
execute(Operation<V,E>... operations)
Executes the ForEach Operation |
|
ForEach.Result<V> |
execute(Operation<V,E> operation)
Executes the ForEach Operation |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForEach(Iterable<E>... iterables)
iterables - ForEachpublic ForEach(Iterable<E> iterable)
iterable - ForEach| Method Detail |
|---|
public <O> V execute(CollectionUtils.CollectionConverter<O,V> collectionConverter,
Operation<O,E>... operations)
Operation and uses the given CollectionUtils.CollectionConverter to produce a single result value
collectionConverter - operations -
public ForEach.Result<V> execute(Operation<V,E> operation)
ForEach Operation
execute in interface Operation<ForEach.Result<V>,Operation<V,E>>operation -
public ForEach.Result<V> execute(Operation<V,E>... operations)
ForEach Operation
operations -
public ForEach<E,V> doExecuteInParallelUsing(ExecutorService executorService)
executorService - the executorService to set
public ForEach<E,V> doIterateInParallelUsing(ExecutorService executorService,
int numberOfThreads)
Iterables have to have threadsafe Iterable.iterator() instances, since even
the Iterators will be called from parallel running threads.ArrayList do not provide thread safe iterators, so do only use
this option, if you have special Iterators in place.
executorService - the executorService to setnumberOfThreads -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||