|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openscience.cdk.io.ChemObjectIO
org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader<IAtomContainer>
org.openscience.cdk.io.iterator.IteratingSDFReader
@TestClass(value="org.openscience.cdk.io.iterator.IteratingSDFReaderTest") public class IteratingSDFReader
Iterating MDL SDF reader. It allows to iterate over all molecules
in the SD file, without reading them into memory first. Suitable
for (very) large SDF files. For parsing the molecules in the
SD file, it uses the MDLV2000Reader or
MDLV3000Reader reader; it does not work
for SDF files with MDL formats prior to the V2000 format.
Example use:
File sdfFile = new File("../zinc-structures/ZINC_subset3_3D_charged_wH_maxmin1000.sdf");
IteratingMDLReader reader = new IteratingMDLReader(
new FileInputStream(sdfFile), DefaultChemObjectBuilder.getInstance()
);
while (reader.hasNext()) {
IMolecule molecule = (IMolecule)reader.next();
}
MDLV2000Reader,
MDLV3000Reader| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.openscience.cdk.io.IChemObjectReader |
|---|
IChemObjectReader.Mode |
| Constructor Summary | |
|---|---|
IteratingSDFReader(InputStream in,
IChemObjectBuilder builder)
Constructs a new IteratingMDLReader that can read Molecule from a given InputStream. |
|
IteratingSDFReader(InputStream in,
IChemObjectBuilder builder,
boolean skip)
Constructs a new IteratingMDLReader that can read Molecule from a given a InputStream. |
|
IteratingSDFReader(Reader in,
IChemObjectBuilder builder)
Constructs a new IteratingMDLReader that can read Molecule from a given Reader. |
|
IteratingSDFReader(Reader in,
IChemObjectBuilder builder,
boolean skip)
Constructs a new IteratingMDLReader that can read Molecule from a given a Reader. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this IChemObjectIO's resources. |
void |
customizeJob()
|
IResourceFormat |
getFormat()
Returns the IResourceFormat class for this IO class. |
boolean |
hasNext()
Returns true if another IMolecule can be read. |
IAtomContainer |
next()
Returns the next IMolecule. |
void |
remove()
File IO generally does not support removing of entries. |
void |
setReader(InputStream reader)
Sets the InputStream from which this ChemObjectReader should read the contents. |
void |
setReader(Reader reader)
Sets the Reader from which this ChemObjectReader should read the contents. |
void |
setSkip(boolean skip)
Indicate whether the reader should skip over SDF records that cause problems. |
| Methods inherited from class org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader |
|---|
accepts, handleError, handleError, handleError, handleError, setErrorHandler, setReaderMode |
| Methods inherited from class org.openscience.cdk.io.ChemObjectIO |
|---|
addChemObjectIOListener, addSetting, addSettings, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openscience.cdk.io.IChemObjectIO |
|---|
addChemObjectIOListener, addSetting, addSettings, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener |
| Constructor Detail |
|---|
public IteratingSDFReader(Reader in,
IChemObjectBuilder builder)
in - The Reader to read frombuilder - The builder
@TestMethod(value="testReadDataItems")
public IteratingSDFReader(InputStream in,
IChemObjectBuilder builder)
in - The InputStream to read frombuilder - The builder
public IteratingSDFReader(InputStream in,
IChemObjectBuilder builder,
boolean skip)
in - the InputStream to read frombuilder - builder to useskip - whether to skip null molecules
public IteratingSDFReader(Reader in,
IChemObjectBuilder builder,
boolean skip)
in - the Reader to read frombuilder - builder to useskip - whether to skip null molecules| Method Detail |
|---|
@TestMethod(value="testGetFormat") public IResourceFormat getFormat()
IChemObjectIOIResourceFormat class for this IO class.
public boolean hasNext()
public void setSkip(boolean skip)
skip - ignore error molecules continue readingpublic IAtomContainer next()
@TestMethod(value="testClose")
public void close()
throws IOException
IChemObjectIO
IOExceptionpublic void remove()
DefaultIteratingChemObjectReader
remove in interface Iterator<IAtomContainer>remove in class DefaultIteratingChemObjectReader<IAtomContainer>@TestMethod(value="testSetReader_Reader") public void setReader(Reader reader)
IChemObjectReader
@TestMethod(value="testSetReader_InputStream") public void setReader(InputStream reader)
IChemObjectReader
public void customizeJob()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||