Package chemaxon.util.concurrent.marvin
Class MolInputProducer
- java.lang.Object
-
- chemaxon.util.concurrent.marvin.MolInputProducer
-
- All Implemented Interfaces:
chemaxon.util.concurrent.InputProducer
,chemaxon.util.concurrent.util.ConcurrentIterator
@PublicAPI public class MolInputProducer extends Object implements chemaxon.util.concurrent.InputProducer
Input producer wrapping aMolImporter
object. ProducesMolecule
objects for the concurrent plugin examples.- Since:
- Marvin 5.0
-
-
Constructor Summary
Constructors Constructor Description MolInputProducer()
Constructor.MolInputProducer(MolImporter importer)
Constructor.MolInputProducer(MolImporter[] importers)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the importers.Object
getNext()
Returns the next input molecule.boolean
hasNext()
Returnstrue
if there are more molecules,false
if end has been reached.protected Molecule
read(MolImporter importer)
-
-
-
Constructor Detail
-
MolInputProducer
public MolInputProducer() throws ExecutionException
Constructor. Creates a molecule importer which will read the standard input.- Throws:
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 InterruptedException, ExecutionException
Returnstrue
if there are more molecules,false
if end has been reached.- Specified by:
hasNext
in interfacechemaxon.util.concurrent.util.ConcurrentIterator
- Returns:
true
if there are more molecules- Throws:
InterruptedException
ExecutionException
-
getNext
public Object getNext() throws InterruptedException, ExecutionException
Returns the next input molecule.- Specified by:
getNext
in interfacechemaxon.util.concurrent.util.ConcurrentIterator
- Returns:
- the next input molecule
- Throws:
InterruptedException
ExecutionException
-
read
protected Molecule read(MolImporter importer) throws IOException
- Throws:
IOException
-
close
public void close() throws ExecutionException
Closes the importers.- Throws:
ExecutionException
-
-