$darkmode
DENOPTIM
|
An iterator that take IAtomContainer
s from a file, possibly using an available iterating reader, or, if such reader does not exist, reads the whole file and collects the containers exposing the iterator over the list of containers.
More...
Public Member Functions | |
IteratingAtomContainerReader (File input) throws FileNotFoundException, IOException, CDKException | |
Constructs an iterator over the containers that can be found in the given file. More... | |
boolean | hasNext () |
IAtomContainer | next () |
void | close () throws IOException |
Close the memory-efficient iterator if any is open. More... | |
Class<?> | getIteratorType () |
Private Attributes | |
List< IAtomContainer > | results |
The containers loaded in memory, or null if we use an Iterator. More... | |
Iterator< IAtomContainer > | listIterator |
Reference to the iterator over pre-loaded containers or null if we use the memory-efficient iterator over the file content. More... | |
DefaultIteratingChemObjectReader< IAtomContainer > | fileIterator |
Reference to the memory-efficient iterator, or null if we have had to pre-load all containers. More... | |
boolean | usingIteratingReader = false |
Flag indicating whether we are using a memory-efficient iterator (true of id we have had to pre-load all containers. More... | |
An iterator that take IAtomContainer
s from a file, possibly using an available iterating reader, or, if such reader does not exist, reads the whole file and collects the containers exposing the iterator over the list of containers.
In the latter case, the memory demands are important, so unless a memory-efficient reader is available (see implementations of IteratingSDFReader
, this iterator should be used only if the expected size of the input file is small.
Definition at line 34 of file IteratingAtomContainerReader.java.
denoptim.io.IteratingAtomContainerReader.IteratingAtomContainerReader | ( | File | input | ) | throws FileNotFoundException, IOException, CDKException |
Constructs an iterator over the containers that can be found in the given file.
input | the file to read. |
FileNotFoundException | |
IOException | |
CDKException |
Definition at line 70 of file IteratingAtomContainerReader.java.
References denoptim.io.IteratingAtomContainerReader.fileIterator, denoptim.io.IteratingAtomContainerReader.listIterator, denoptim.io.DenoptimIO.readAllAtomContainers(), denoptim.io.IteratingAtomContainerReader.results, and denoptim.io.IteratingAtomContainerReader.usingIteratingReader.
void denoptim.io.IteratingAtomContainerReader.close | ( | ) | throws IOException |
Close the memory-efficient iterator if any is open.
Does nothing if we are using the iterator over pre-loaded containers.
IOException | if the wrapper cannot be closed. |
Definition at line 128 of file IteratingAtomContainerReader.java.
References denoptim.io.IteratingAtomContainerReader.fileIterator.
Referenced by denoptim.fragmenter.FragmenterTools.fragmentation(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads().
Class<?> denoptim.io.IteratingAtomContainerReader.getIteratorType | ( | ) |
Definition at line 139 of file IteratingAtomContainerReader.java.
References denoptim.io.IteratingAtomContainerReader.fileIterator, denoptim.io.IteratingAtomContainerReader.listIterator, and denoptim.io.IteratingAtomContainerReader.usingIteratingReader.
Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.fragmenter.ParallelFragmentationAlgorithm.doPreFlightOperations(), and denoptim.ga.EvolutionaryAlgorithm.initializePopulation().
boolean denoptim.io.IteratingAtomContainerReader.hasNext | ( | ) |
Definition at line 102 of file IteratingAtomContainerReader.java.
References denoptim.io.IteratingAtomContainerReader.fileIterator, denoptim.io.IteratingAtomContainerReader.listIterator, and denoptim.io.IteratingAtomContainerReader.usingIteratingReader.
Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.ga.EvolutionaryAlgorithm.initializePopulation(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads().
IAtomContainer denoptim.io.IteratingAtomContainerReader.next | ( | ) |
Definition at line 113 of file IteratingAtomContainerReader.java.
References denoptim.io.IteratingAtomContainerReader.fileIterator, denoptim.io.IteratingAtomContainerReader.listIterator, and denoptim.io.IteratingAtomContainerReader.usingIteratingReader.
Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.ga.EvolutionaryAlgorithm.initializePopulation(), and denoptim.fragmenter.ParallelFragmentationAlgorithm.splitInputForThreads().
|
private |
Reference to the memory-efficient iterator, or null if we have had to pre-load all containers.
Definition at line 52 of file IteratingAtomContainerReader.java.
Referenced by denoptim.io.IteratingAtomContainerReader.close(), denoptim.io.IteratingAtomContainerReader.getIteratorType(), denoptim.io.IteratingAtomContainerReader.hasNext(), denoptim.io.IteratingAtomContainerReader.IteratingAtomContainerReader(), and denoptim.io.IteratingAtomContainerReader.next().
|
private |
Reference to the iterator over pre-loaded containers or null if we use the memory-efficient iterator over the file content.
Definition at line 46 of file IteratingAtomContainerReader.java.
Referenced by denoptim.io.IteratingAtomContainerReader.getIteratorType(), denoptim.io.IteratingAtomContainerReader.hasNext(), denoptim.io.IteratingAtomContainerReader.IteratingAtomContainerReader(), and denoptim.io.IteratingAtomContainerReader.next().
|
private |
The containers loaded in memory, or null if we use an Iterator.
Definition at line 40 of file IteratingAtomContainerReader.java.
Referenced by denoptim.io.IteratingAtomContainerReader.IteratingAtomContainerReader().
|
private |
Flag indicating whether we are using a memory-efficient iterator (true
of id we have had to pre-load all containers.
Definition at line 58 of file IteratingAtomContainerReader.java.
Referenced by denoptim.io.IteratingAtomContainerReader.getIteratorType(), denoptim.io.IteratingAtomContainerReader.hasNext(), denoptim.io.IteratingAtomContainerReader.IteratingAtomContainerReader(), and denoptim.io.IteratingAtomContainerReader.next().