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
ConstructorsConstructorDescriptionConstructor.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
Returnstrueif there are more molecules,falseif end has been reached.- Specified by:
hasNextin interfacechemaxon.util.concurrent.util.ConcurrentIterator<Molecule>- Returns:
trueif there are more molecules- Throws:
InterruptedExceptionExecutionException
-
getNext
Returns the next input molecule.- Specified by:
getNextin interfacechemaxon.util.concurrent.util.ConcurrentIterator<Molecule>- Returns:
- the next input molecule
- Throws:
InterruptedExceptionExecutionException
-
read
- Throws:
IOException
-
close
Closes the importers.- Throws:
ExecutionException
-