Package chemaxon.util.concurrent.marvin
Class MolInputProducer
java.lang.Object
chemaxon.util.concurrent.marvin.MolInputProducer
- All Implemented Interfaces:
chemaxon.util.concurrent.InputProducer<Molecule>
,chemaxon.util.concurrent.util.ConcurrentIterator<Molecule>
@PublicApi
public class MolInputProducer
extends Object
implements chemaxon.util.concurrent.InputProducer<Molecule>
Input producer wrapping a
MolImporter
object.
Produces Molecule
objects for the concurrent plugin examples.- Since:
- Marvin 5.0
-
Constructor Summary
ConstructorDescriptionConstructor.MolInputProducer
(MolImporter importer) Constructor.MolInputProducer
(MolImporter[] importers) Constructor. -
Method Summary
-
Constructor Details
-
MolInputProducer
Constructor. Creates a molecule importer which will read the standard input.- Throws:
ExecutionException
-
MolInputProducer
Constructor. Sets a single molecule importer.- Parameters:
importer
- the molecule importer object
-
MolInputProducer
Constructor. Sets the molecule importers.- Parameters:
importers
- the molecule importer objects
-
-
Method Details
-
hasNext
Returnstrue
if there are more molecules,false
if end has been reached.- Specified by:
hasNext
in interfacechemaxon.util.concurrent.util.ConcurrentIterator<Molecule>
- Returns:
true
if there are more molecules- Throws:
InterruptedException
ExecutionException
-
getNext
Returns the next input molecule.- Specified by:
getNext
in interfacechemaxon.util.concurrent.util.ConcurrentIterator<Molecule>
- Returns:
- the next input molecule
- Throws:
InterruptedException
ExecutionException
-
read
- Throws:
IOException
-
close
Closes the importers.- Throws:
ExecutionException
-