chemaxon.util.concurrent.marvin
Class CompositeWorkUnit

java.lang.Object
  extended by chemaxon.util.concurrent.marvin.CompositeWorkUnit
All Implemented Interfaces:
WorkUnit, edu.emory.mathcs.backport.java.util.concurrent.Callable

public class CompositeWorkUnit
extends java.lang.Object
implements WorkUnit

Work unit composed of an array of work units, to be called in a linear fashion in a single thread, one after the other in the specified order. The provided output is an array of outputs provided by these work units.

Since:
Marvin 5.0
Author:
Nora Mate

Field Summary
protected  WorkUnit[] workUnits
          The array of work units.
 
Constructor Summary
CompositeWorkUnit()
          Constructor.
CompositeWorkUnit(WorkUnit[] workUnits)
          Constructor.
 
Method Summary
 java.lang.Object call()
          Performs the work unit tasks in a linear fashion, one after the other.
 void setInput(java.lang.Object obj)
          Sets the input in each work unit.
 void setWorkUnits(WorkUnit[] workUnits)
          Sets the work units.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workUnits

protected WorkUnit[] workUnits
The array of work units.

Constructor Detail

CompositeWorkUnit

public CompositeWorkUnit()
Constructor. Work units should be set by setWorkUnits(chemaxon.util.concurrent.WorkUnit[]).


CompositeWorkUnit

public CompositeWorkUnit(WorkUnit[] workUnits)
Constructor. Sets the work units.

Parameters:
workUnits - the work units
Method Detail

setWorkUnits

public void setWorkUnits(WorkUnit[] workUnits)
Sets the work units.

Parameters:
workUnits - the work units

setInput

public void setInput(java.lang.Object obj)
              throws edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Sets the input in each work unit.

Specified by:
setInput in interface WorkUnit
Parameters:
obj - the input object
Throws:
edu.emory.mathcs.backport.java.util.concurrent.ExecutionException

call

public java.lang.Object call()
                      throws java.lang.Exception
Performs the work unit tasks in a linear fashion, one after the other.

Specified by:
call in interface edu.emory.mathcs.backport.java.util.concurrent.Callable
Returns:
the result array (one result object for each work unit)
Throws:
java.lang.Exception