lumis.util
Class CollectionExecutor<T>

Package class diagram package CollectionExecutor
java.lang.Object
  extended by lumis.util.CollectionExecutor<T>
Type Parameters:
T - the type of the collection elements.

public class CollectionExecutor<T>
extends Object

Utility used to process collections in blocks.

Currently each block is fixed in a maximum size of 1000 elements.

Since:
4.2.2.090330

Nested Class Summary
static interface CollectionExecutor.IIterationCommand<T>
          Interface that is implemented to provide the command for executing a block of a collection.
 
Constructor Summary
CollectionExecutor(Collection<? extends T> items)
          Creates a new executor.
 
Method Summary
 void execute(CollectionExecutor.IIterationCommand<T> command)
          Executes a command on the collection in this executor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionExecutor

public CollectionExecutor(Collection<? extends T> items)
Creates a new executor.

Parameters:
items - the collection to be processed in blocks.
Since:
4.2.2.090330
Method Detail

execute

public void execute(CollectionExecutor.IIterationCommand<T> command)
             throws PortalException
Executes a command on the collection in this executor. 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.

Parameters:
command - the command to be executed.
Throws:
PortalException
Since:
4.2.2.090330


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.