public final class FJIterate extends Object
forEach
.
The forEach algorithm employs a batching fork and join approach.
All Collections that are not either a RandomAccess
or List
are first converted to a Java array
using Iterate.toArray(Iterable)
, and then run with one of the FJIterate.forEach
methods.
ParallelIterate
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_MIN_FORK_SIZE |
Modifier and Type | Method | Description |
---|---|---|
static <T,K,V> MutableMap<K,V> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator) |
|
static <T,K,V> MutableMap<K,V> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator,
int batchSize) |
|
static <T,K,V> MutableMap<K,V> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator,
int batchSize,
ForkJoinPool executor) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator,
R mutableMap) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator,
R mutableMap,
int batchSize) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Function2<? super V,? super T,? extends V> nonMutatingAggregator,
R mutableMap,
int batchSize,
ForkJoinPool executor) |
|
static <T,K,V> MutableMap<K,V> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator) |
|
static <T,K,V> MutableMap<K,V> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator,
int batchSize) |
|
static <T,K,V> MutableMap<K,V> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator,
int batchSize,
ForkJoinPool executor) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator,
R mutableMap) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator,
R mutableMap,
int batchSize) |
|
static <T,K,V,R extends MutableMapIterable<K,V>> |
aggregateInPlaceBy(Iterable<T> iterable,
Function<? super T,? extends K> groupBy,
Function0<? extends V> zeroValueFactory,
Procedure2<? super V,? super T> mutatingAggregator,
R mutableMap,
int batchSize,
ForkJoinPool executor) |
|
static <T,V> Collection<V> |
collect(Iterable<T> iterable,
Function<? super T,V> function) |
Same effect as
Iterate.collect(Iterable, Function) ,
but executed in parallel batches. |
static <T,V> Collection<V> |
collect(Iterable<T> iterable,
Function<? super T,V> function,
boolean allowReorderedResult) |
Same effect as
Iterate.collect(Iterable, Function) , but executed in parallel batches,
and with potentially reordered result. |
static <T,V,R extends Collection<V>> |
collect(Iterable<T> iterable,
Function<? super T,V> function,
R target,
boolean allowReorderedResult) |
Same effect as
Iterate.collect(Iterable, Function) , but executed in parallel batches,
and writing output into the specified collection. |
static <T,V,R extends Collection<V>> |
collect(Iterable<T> iterable,
Function<? super T,V> function,
R target,
int batchSize,
ForkJoinPool executor,
boolean allowReorderedResult) |
|
static <T,V> Collection<V> |
collectIf(Iterable<T> iterable,
Predicate<? super T> predicate,
Function<? super T,V> function) |
Same effect as
Iterate.collectIf(Iterable, Predicate, Function) ,
but executed in parallel batches. |
static <T,V> Collection<V> |
collectIf(Iterable<T> iterable,
Predicate<? super T> predicate,
Function<? super T,V> function,
boolean allowReorderedResult) |
Same effect as
Iterate.collectIf(Iterable, Predicate, Function) ,
but executed in parallel batches, and with potentially reordered results. |
static <T,V,R extends Collection<V>> |
collectIf(Iterable<T> iterable,
Predicate<? super T> predicate,
Function<? super T,V> function,
R target,
boolean allowReorderedResult) |
Same effect as
Iterate.collectIf(Iterable, Predicate, Function) ,
but executed in parallel batches, and writing output into the specified collection. |
static <T,V,R extends Collection<V>> |
collectIf(Iterable<T> iterable,
Predicate<? super T> predicate,
Function<? super T,V> function,
R target,
int batchSize,
ForkJoinPool executor,
boolean allowReorderedResult) |
|
static <T> int |
count(Iterable<T> iterable,
Predicate<? super T> predicate) |
Same effect as
Iterate.count(Iterable, Predicate) , but executed in parallel batches. |
static <T> int |
count(Iterable<T> iterable,
Predicate<? super T> predicate,
int batchSize,
ForkJoinPool executor) |
Same effect as
Iterate.count(Iterable, Predicate) , but executed in parallel batches. |
static <T,V> Collection<V> |
flatCollect(Iterable<T> iterable,
Function<? super T,? extends Iterable<V>> function) |
|
static <T,V> Collection<V> |
flatCollect(Iterable<T> iterable,
Function<? super T,? extends Iterable<V>> function,
boolean allowReorderedResult) |
|
static <T,V,R extends Collection<V>> |
flatCollect(Iterable<T> iterable,
Function<? super T,? extends Iterable<V>> function,
R target,
boolean allowReorderedResult) |
|
static <T,V,R extends Collection<V>> |
flatCollect(Iterable<T> iterable,
Function<? super T,? extends Iterable<V>> function,
R target,
int batchSize,
ForkJoinPool executor,
boolean allowReorderedResult) |
|
static <T> void |
forEach(Iterable<T> iterable,
Procedure<? super T> procedure) |
Iterate over the collection specified in parallel batches using default runtime parameter values.
|
static <T> void |
forEach(Iterable<T> iterable,
Procedure<? super T> procedure,
int batchSize) |
Iterate over the collection specified in parallel batches using default runtime parameter values.
|
static <T> void |
forEach(Iterable<T> iterable,
Procedure<? super T> procedure,
int batchSize,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int batchSize) |
Iterate over the collection specified in parallel batches using the default values for the task size.
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount) |
Iterate over the collection specified in parallel batches using the default values for the task size.
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> blockFactory,
Combiner<PT> combiner,
int batchSize,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
PT procedure,
int minForkSize,
int taskCount) |
Iterate over the collection specified in parallel batches using the specified minimum fork and task count sizes.
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
PT procedure,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEach(Iterable<T> iterable,
PT procedure,
ForkJoinPool executor) |
Iterate over the collection specified in parallel batches using default runtime parameter values
and the specified executor.
|
static <T,PT extends Procedure<? super T>> |
forEachInBatchWithExecutor(BatchIterable<T> batchIterable,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <T,PT extends Procedure<? super T>> |
forEachInListOnExecutor(List<T> list,
ProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <T> void |
forEachWithIndex(Iterable<T> iterable,
ObjectIntProcedure<? super T> procedure) |
Iterate over the collection specified, in parallel batches using default runtime parameter values.
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndex(Iterable<T> iterable,
ObjectIntProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount) |
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndex(Iterable<T> iterable,
ObjectIntProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndex(Iterable<T> iterable,
ObjectIntProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
ForkJoinPool executor) |
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndex(Iterable<T> iterable,
PT procedure,
int minForkSize,
int taskCount) |
Iterate over the collection specified in parallel batches.
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndex(Iterable<T> iterable,
PT procedure,
ForkJoinPool executor) |
Iterate over the collection specified in parallel batches using the default runtime parameters.
|
static <T,PT extends ObjectIntProcedure<? super T>> |
forEachWithIndexInListOnExecutor(List<T> list,
ObjectIntProcedureFactory<PT> procedureFactory,
Combiner<PT> combiner,
int minForkSize,
int taskCount,
ForkJoinPool executor) |
|
static <K,V> MutableMultimap<K,V> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <K,V> MutableMultimap<K,V> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function,
int batchSize) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <K,V> MutableMultimap<K,V> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function,
int batchSize,
ForkJoinPool executor) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <K,V,R extends MutableMultimap<K,V>> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function,
R concurrentMultimap) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <K,V,R extends MutableMultimap<K,V>> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function,
R concurrentMultimap,
int batchSize) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <K,V,R extends MutableMultimap<K,V>> |
groupBy(Iterable<V> iterable,
Function<? super V,? extends K> function,
R concurrentMultimap,
int batchSize,
ForkJoinPool executor) |
Same effect as
Iterate.groupBy(Iterable, Function) ,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. |
static <T> Collection<T> |
reject(Iterable<T> iterable,
Predicate<? super T> predicate) |
Same effect as
Iterate.reject(Iterable, Predicate) , but executed in parallel batches. |
static <T> Collection<T> |
reject(Iterable<T> iterable,
Predicate<? super T> predicate,
boolean allowReorderedResult) |
Same effect as
Iterate.reject(Iterable, Predicate) , but executed in parallel batches,
and with a potentially reordered result. |
static <T,R extends Collection<T>> |
reject(Iterable<T> iterable,
Predicate<? super T> predicate,
R target,
boolean allowReorderedResult) |
Same effect as
Iterate.reject(Iterable, Predicate) , but executed in parallel batches,
and writing output into the specified collection. |
static <T,R extends Collection<T>> |
reject(Iterable<T> iterable,
Predicate<? super T> predicate,
R target,
int batchSize,
ForkJoinPool executor,
boolean allowReorderedResult) |
|
static <T> Collection<T> |
select(Iterable<T> iterable,
Predicate<? super T> predicate) |
Same effect as
Iterate.select(Iterable, Predicate) , but executed in parallel batches. |
static <T> Collection<T> |
select(Iterable<T> iterable,
Predicate<? super T> predicate,
boolean allowReorderedResult) |
Same effect as
Iterate.select(Iterable, Predicate) , but executed in parallel batches,
and with a potentially reordered result. |
static <T,R extends Collection<T>> |
select(Iterable<T> iterable,
Predicate<? super T> predicate,
R target,
boolean allowReorderedResult) |
Same effect as
Iterate.select(Iterable, Predicate) , but executed in parallel batches,
and writing output into the specified collection. |
static <T,R extends Collection<T>> |
select(Iterable<T> iterable,
Predicate<? super T> predicate,
R target,
int batchSize,
ForkJoinPool executor,
boolean allowReorderedResult) |
Same effect as
Iterate.select(Iterable, Predicate) , but executed in parallel batches,
and writing output into the specified collection. |
public static final int DEFAULT_MIN_FORK_SIZE
public static <T> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> procedure)
ObjectIntProcedure
used must be stateless, or use concurrent aware objects if they are to be shared.
e.g.
final ConcurrentMutableMap<Integer, Object> chm = new ConcurrentHashMap<Integer, Object>();
FJIterate.forEachWithIndex(collection, new ObjectIntProcedure()
{
public void value(Object object, int index)
{
chm.put(index, object);
}
});
public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(Iterable<T> iterable, PT procedure, ForkJoinPool executor)
e.g.
final ConcurrentMutableMap<Integer, Object> chm = new ConcurrentHashMap<Integer, Object>();
FJIterate.forEachWithIndex(collection, new ObjectIntProcedure()
{
public void value(Object object, int index)
{
chm.put(index, object);
}
}, executor);
executor
- Use this executor for all execution.public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(Iterable<T> iterable, PT procedure, int minForkSize, int taskCount)
minForkSize
- Only run in parallel if input collection is longer than this.taskCount
- The number of parallel tasks to submit to the executor.forEachWithIndex(Iterable, ObjectIntProcedure)
public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, ForkJoinPool executor)
public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount)
public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T,PT extends ObjectIntProcedure<? super T>> void forEachWithIndexInListOnExecutor(List<T> list, ObjectIntProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure)
Procedure
used must be stateless, or use concurrent aware objects if they are to be shared.
e.g.
final ConcurrentMutableMap<Object, Boolean> chm = new ConcurrentHashMap<Object, Boolean>();
FJIterate.forEach(collection, new Procedure()
{
public void value(Object object)
{
chm.put(object, Boolean.TRUE);
}
});
public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure, int batchSize)
Procedure
used must be stateless, or use concurrent aware objects if they are to be shared.
e.g.
final ConcurrentMutableMap<Object, Boolean> chm = new ConcurrentHashMap<Object, Boolean>();
FJIterate.forEachBatchSize(collection, new Procedure()
{
public void value(Object object)
{
chm.put(object, Boolean.TRUE);
}
}, 100);
public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure, int batchSize, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, PT procedure, ForkJoinPool executor)
Procedure
used must be stateless, or use concurrent aware objects if they are to be shared.executor
- Use this executor for all execution.forEach(Iterable, Procedure)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, PT procedure, int minForkSize, int taskCount)
Procedure
used must be stateless, or use concurrent aware objects if they are to be shared.minForkSize
- Only run in parallel if input collection is longer than this.taskCount
- The number of parallel tasks to submit to the executor.forEach(Iterable, Procedure)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, PT procedure, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int batchSize)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> blockFactory, Combiner<PT> combiner, int batchSize, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount)
public static <T,PT extends Procedure<? super T>> void forEach(Iterable<T> iterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEachInListOnExecutor(List<T> list, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T,PT extends Procedure<? super T>> void forEachInBatchWithExecutor(BatchIterable<T> batchIterable, ProcedureFactory<PT> procedureFactory, Combiner<PT> combiner, int minForkSize, int taskCount, ForkJoinPool executor)
public static <T> Collection<T> select(Iterable<T> iterable, Predicate<? super T> predicate)
Iterate.select(Iterable, Predicate)
, but executed in parallel batches.select(Iterable, Predicate, boolean)
public static <T> Collection<T> select(Iterable<T> iterable, Predicate<? super T> predicate, boolean allowReorderedResult)
Iterate.select(Iterable, Predicate)
, but executed in parallel batches,
and with a potentially reordered result.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,R extends Collection<T>> R select(Iterable<T> iterable, Predicate<? super T> predicate, R target, boolean allowReorderedResult)
Iterate.select(Iterable, Predicate)
, but executed in parallel batches,
and writing output into the specified collection.target
- Where to write the output.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,R extends Collection<T>> R select(Iterable<T> iterable, Predicate<? super T> predicate, R target, int batchSize, ForkJoinPool executor, boolean allowReorderedResult)
Iterate.select(Iterable, Predicate)
, but executed in parallel batches,
and writing output into the specified collection.target
- Where to write the output.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T> Collection<T> reject(Iterable<T> iterable, Predicate<? super T> predicate)
Iterate.reject(Iterable, Predicate)
, but executed in parallel batches.reject(Iterable, Predicate, boolean)
public static <T> Collection<T> reject(Iterable<T> iterable, Predicate<? super T> predicate, boolean allowReorderedResult)
Iterate.reject(Iterable, Predicate)
, but executed in parallel batches,
and with a potentially reordered result.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,R extends Collection<T>> R reject(Iterable<T> iterable, Predicate<? super T> predicate, R target, boolean allowReorderedResult)
Iterate.reject(Iterable, Predicate)
, but executed in parallel batches,
and writing output into the specified collection.target
- Where to write the output.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,R extends Collection<T>> R reject(Iterable<T> iterable, Predicate<? super T> predicate, R target, int batchSize, ForkJoinPool executor, boolean allowReorderedResult)
public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate)
Iterate.count(Iterable, Predicate)
, but executed in parallel batches.public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate, int batchSize, ForkJoinPool executor)
Iterate.count(Iterable, Predicate)
, but executed in parallel batches.public static <T,V> Collection<V> collect(Iterable<T> iterable, Function<? super T,V> function)
Iterate.collect(Iterable, Function)
,
but executed in parallel batches.collect(Iterable, Function, boolean)
public static <T,V> Collection<V> collect(Iterable<T> iterable, Function<? super T,V> function, boolean allowReorderedResult)
Iterate.collect(Iterable, Function)
, but executed in parallel batches,
and with potentially reordered result.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,V,R extends Collection<V>> R collect(Iterable<T> iterable, Function<? super T,V> function, R target, boolean allowReorderedResult)
Iterate.collect(Iterable, Function)
, but executed in parallel batches,
and writing output into the specified collection.target
- Where to write the output.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,V,R extends Collection<V>> R collect(Iterable<T> iterable, Function<? super T,V> function, R target, int batchSize, ForkJoinPool executor, boolean allowReorderedResult)
public static <T,V> Collection<V> flatCollect(Iterable<T> iterable, Function<? super T,? extends Iterable<V>> function)
public static <T,V> Collection<V> flatCollect(Iterable<T> iterable, Function<? super T,? extends Iterable<V>> function, boolean allowReorderedResult)
public static <T,V,R extends Collection<V>> R flatCollect(Iterable<T> iterable, Function<? super T,? extends Iterable<V>> function, R target, boolean allowReorderedResult)
public static <T,V,R extends Collection<V>> R flatCollect(Iterable<T> iterable, Function<? super T,? extends Iterable<V>> function, R target, int batchSize, ForkJoinPool executor, boolean allowReorderedResult)
public static <T,V> Collection<V> collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T,V> function)
Iterate.collectIf(Iterable, Predicate, Function)
,
but executed in parallel batches.collectIf(Iterable, Predicate, Function, boolean)
public static <T,V> Collection<V> collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T,V> function, boolean allowReorderedResult)
Iterate.collectIf(Iterable, Predicate, Function)
,
but executed in parallel batches, and with potentially reordered results.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,V,R extends Collection<V>> R collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T,V> function, R target, boolean allowReorderedResult)
Iterate.collectIf(Iterable, Predicate, Function)
,
but executed in parallel batches, and writing output into the specified collection.target
- Where to write the output.allowReorderedResult
- If the result can be in a different order.
Allowing reordering may yield faster execution.public static <T,V,R extends Collection<V>> R collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T,V> function, R target, int batchSize, ForkJoinPool executor, boolean allowReorderedResult)
public static <T,K,V> MutableMap<K,V> aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator, R mutableMap)
public static <T,K,V> MutableMap<K,V> aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator, int batchSize)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator, R mutableMap, int batchSize)
public static <T,K,V> MutableMap<K,V> aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator, int batchSize, ForkJoinPool executor)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V,? super T,? extends V> nonMutatingAggregator, R mutableMap, int batchSize, ForkJoinPool executor)
public static <T,K,V> MutableMap<K,V> aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator, R mutableMap)
public static <T,K,V> MutableMap<K,V> aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator, int batchSize)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator, R mutableMap, int batchSize)
public static <T,K,V> MutableMap<K,V> aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator, int batchSize, ForkJoinPool executor)
public static <T,K,V,R extends MutableMapIterable<K,V>> R aggregateInPlaceBy(Iterable<T> iterable, Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator, R mutableMap, int batchSize, ForkJoinPool executor)
public static <K,V> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.public static <K,V,R extends MutableMultimap<K,V>> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function, R concurrentMultimap)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.public static <K,V,R extends MutableMultimap<K,V>> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function, R concurrentMultimap, int batchSize)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.public static <K,V> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function, int batchSize)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.public static <K,V> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function, int batchSize, ForkJoinPool executor)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.public static <K,V,R extends MutableMultimap<K,V>> MutableMultimap<K,V> groupBy(Iterable<V> iterable, Function<? super V,? extends K> function, R concurrentMultimap, int batchSize, ForkJoinPool executor)
Iterate.groupBy(Iterable, Function)
,
but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap.Copyright © 2004–2019. All rights reserved.