chemaxon.util.concurrent.marvin
Class MolInputProducer

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

public class MolInputProducer
extends java.lang.Object
implements InputProducer

Input producer wrapping a MolImporter object. Produces Molecule objects for the concurrent plugin examples.

Since:
Marvin 5.0
Author:
Nora Mate

Constructor Summary
MolInputProducer()
          Constructor.
MolInputProducer(MolImporter importer)
          Constructor.
MolInputProducer(MolImporter[] importers)
          Constructor.
 
Method Summary
 void close()
          Closes the importers.
 java.lang.Object getNext()
          Returns the next input molecule.
 boolean hasNext()
          Returns true if there are more molecules, false if end has been reached.
protected  Molecule read(MolImporter importer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MolInputProducer

public MolInputProducer()
                 throws edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Constructor. Creates a molecule importer which will read the standard input.

Throws:
edu.emory.mathcs.backport.java.util.concurrent.ExecutionException

MolInputProducer

public MolInputProducer(MolImporter importer)
Constructor. Sets a single molecule importer.

Parameters:
importer - the molecule importer object

MolInputProducer

public MolInputProducer(MolImporter[] importers)
Constructor. Sets the molecule importers.

Parameters:
importers - the molecule importer objects
Method Detail

hasNext

public boolean hasNext()
                throws java.lang.InterruptedException,
                       edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Returns true if there are more molecules, false if end has been reached.

Specified by:
hasNext in interface chemaxon.util.concurrent.util.ConcurrentIterator
Returns:
true if there are more molecules
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 molecule.

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

read

protected Molecule read(MolImporter importer)
                 throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws edu.emory.mathcs.backport.java.util.concurrent.ExecutionException
Closes the importers.

Throws:
edu.emory.mathcs.backport.java.util.concurrent.ExecutionException