public class IteratingSDFReader extends DefaultIteratingChemObjectReader<IAtomContainer>
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");
IteratingSDFReader reader = new IteratingSDFReader(
new FileInputStream(sdfFile), DefaultChemObjectBuilder.getInstance()
);
while (reader.hasNext()) {
IAtomContainer molecule = (IAtomContainer)reader.next();
}
MDLV2000Reader,
MDLV3000ReaderIChemObjectReader.ModeerrorHandler, mode| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
customizeJob() |
IResourceFormat |
getFormat() |
boolean |
hasNext()
Returns true if another
IAtomContainer can be read. |
IAtomContainer |
next()
Returns the next
IAtomContainer. |
void |
remove() |
void |
setReader(InputStream reader) |
void |
setReader(Reader reader) |
void |
setSkip(boolean skip)
Indicate whether the reader should skip over SDF records
that cause problems.
|
accepts, handleError, handleError, handleError, handleError, setErrorHandler, setReaderModeaddChemObjectIOListener, addSetting, addSettings, fireIOSettingQuestion, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChemObjectIOListener, addSetting, addSettings, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListenerforEachRemainingpublic IteratingSDFReader(Reader in, IChemObjectBuilder builder)
in - The Reader to read frombuilder - The builderpublic IteratingSDFReader(InputStream in, IChemObjectBuilder builder)
in - The InputStream to read frombuilder - The builderpublic IteratingSDFReader(InputStream in, IChemObjectBuilder builder, boolean skip)
in - the InputStream to read frombuilder - builder to useskip - whether to skip null moleculespublic IteratingSDFReader(Reader in, IChemObjectBuilder builder, boolean skip)
in - the Reader to read frombuilder - builder to useskip - whether to skip null moleculespublic IResourceFormat getFormat()
public boolean hasNext()
IAtomContainer can be read.public void setSkip(boolean skip)
skip - ignore error molecules continue readingpublic IAtomContainer next()
IAtomContainer.public void close()
throws IOException
IOExceptionpublic void remove()
remove in interface Iterator<IAtomContainer>remove in class DefaultIteratingChemObjectReader<IAtomContainer>public void setReader(Reader reader)
public void setReader(InputStream reader)
public void customizeJob()
Copyright © 2017. All rights reserved.