T
- the type of the collection elements.public class CollectionExecutor<T> extends Object
Currently each block is fixed in a maximum size, the default value is 1000 elements.
Modifier and Type | Class and Description |
---|---|
static interface |
CollectionExecutor.IIterationCommand<T>
Interface that is implemented to provide the command for executing a
block of a collection.
|
Constructor and Description |
---|
CollectionExecutor(Collection<? extends T> items)
Creates a new executor.
|
CollectionExecutor(Collection<? extends T> items,
int iterationBlock)
Creates a new executor.
|
Modifier and Type | Method and Description |
---|---|
static <T> void |
execute(Collection<T> collection,
CollectionExecutor.IIterationCommand<T> command)
Executes a command on the collection.
|
void |
execute(CollectionExecutor.IIterationCommand<T> command)
Executes a command on the collection in this executor.
|
public CollectionExecutor(Collection<? extends T> items)
items
- the collection to be processed in blocks.public CollectionExecutor(Collection<? extends T> items, int iterationBlock)
items
- the collection to be processed in blocks.iterationBlock
- the maximum number of element in each iteration that calls
CollectionExecutor.IIterationCommand.execute(List)
.public void execute(CollectionExecutor.IIterationCommand<T> command) throws PortalException
CollectionExecutor.IIterationCommand.execute(List)
is called multiple times,
given as argument a sublist of the collection in this executor, in the
same order as the collection's iterator.command
- the command to be executed.PortalException
public static <T> void execute(Collection<T> collection, CollectionExecutor.IIterationCommand<T> command) throws PortalException
CollectionExecutor.IIterationCommand.execute(List)
is called multiple times,
given as argument a sublist of the collection in this executor, in the
same order as the collection's iterator.collection
- the collection to be processed in blocks.command
- the command to be executed.PortalException
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.