|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader ambit2.core.io.MyIteratingMDLReader
public class MyIteratingMDLReader
Copied here (with corrections)until Bug 1758372 in CDK is fixed.
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"); MyIteratingMDLReader reader = new MyIteratingMDLReader( new FileInputStream(sdfFile), DefaultChemObjectBuilder.getInstance() ); while (reader.hasNext()) { IMolecule molecule = (IMolecule)reader.next(); }cdk.module io
MDLV2000Reader
,
MDLV3000Reader
Constructor Summary | |
---|---|
MyIteratingMDLReader(java.io.InputStream in,
org.openscience.cdk.interfaces.IChemObjectBuilder builder)
Contructs a new MyIteratingMDLReader that can read Molecule from a given InputStream. |
|
MyIteratingMDLReader(java.io.Reader in,
org.openscience.cdk.interfaces.IChemObjectBuilder builder)
Contructs a new MyIteratingMDLReader that can read Molecule from a given Reader. |
Method Summary | |
---|---|
void |
close()
|
org.openscience.cdk.io.formats.IResourceFormat |
getFormat()
|
boolean |
hasNext()
Returns true if another IMolecule can be read. |
java.lang.Object |
next()
Returns the next IMolecule. |
void |
remove()
|
Methods inherited from class org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader |
---|
accepts, addChemObjectIOListener, fireFrameRead, fireIOSettingQuestion, getIOSettings, removeChemObjectIOListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MyIteratingMDLReader(java.io.Reader in, org.openscience.cdk.interfaces.IChemObjectBuilder builder)
in
- The Reader to read frompublic MyIteratingMDLReader(java.io.InputStream in, org.openscience.cdk.interfaces.IChemObjectBuilder builder)
in
- The InputStream to read fromMethod Detail |
---|
public org.openscience.cdk.io.formats.IResourceFormat getFormat()
public boolean hasNext()
public java.lang.Object next()
public void close() throws java.io.IOException
java.io.IOException
public void remove()
remove
in interface java.util.Iterator
remove
in class org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |