chemaxon.util.concurrent.marvin
Class CompositeInputProducer

java.lang.Object
  extended by chemaxon.util.concurrent.marvin.CompositeInputProducer
All Implemented Interfaces:
InputProducer, chemaxon.util.concurrent.util.ConcurrentIterator

public class CompositeInputProducer
extends java.lang.Object
implements InputProducer

Input producer composed of an array of input producers. The provided input is an array of inputs provided by these input producers.

Since:
Marvin 5.0
Author:
Nora Mate

Field Summary
protected  InputProducer[] inputProducers
          The input producer array.
 
Constructor Summary
CompositeInputProducer()
          Constructor.
CompositeInputProducer(InputProducer[] inputProducers)
          Constructor.
 
Method Summary
 java.lang.Object getNext()
          Returns the next input object array (one input from each input producer).
 boolean hasNext()
          Returns true if all input producers have next input.
 void setInputProducers(InputProducer[] inputProducers)
          Sets the input producers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputProducers

protected InputProducer[] inputProducers
The input producer array.

Constructor Detail

CompositeInputProducer

public CompositeInputProducer()
Constructor. The input producers should be set by setInputProducers(chemaxon.util.concurrent.InputProducer[])


CompositeInputProducer

public CompositeInputProducer(InputProducer[] inputProducers)
Constructor. Sets the input producers.

Parameters:
inputProducers - the input producer array
Method Detail

setInputProducers

public void setInputProducers(InputProducer[] inputProducers)
Sets the input producers.

Parameters:
inputProducers - the input producer array

hasNext

public boolean hasNext()
                throws java.lang.InterruptedException,
                       edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Returns true if all input producers have next input.

Specified by:
hasNext in interface chemaxon.util.concurrent.util.ConcurrentIterator
Returns:
true if all input producers have next input
Throws:
java.lang.InterruptedException
edu.emory.mathcs.backport.java.util.concurrent.ExecutionException

getNext

public java.lang.Object getNext()
                         throws java.lang.InterruptedException,
                                edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Returns the next input object array (one input from each input producer).

Specified by:
getNext in interface chemaxon.util.concurrent.util.ConcurrentIterator
Returns:
the next input object array
Throws:
java.lang.InterruptedException
edu.emory.mathcs.backport.java.util.concurrent.ExecutionException