Class EventCMLReader
- java.lang.Object
-
- org.openscience.cdk.io.ChemObjectIO
-
- org.openscience.cdk.io.iterator.event.DefaultEventChemObjectReader
-
- org.openscience.cdk.io.iterator.event.EventCMLReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IChemObjectIO
,IEventChemObjectReader
public class EventCMLReader extends DefaultEventChemObjectReader
Reads a molecule in CML 1.x and 2.0 format. CML is an XML based application [Murray-Rust, P. and Rzepa, H.S.. Journal of Chemical Information and Computer Sciences. 1999. 39], and this Reader applies the method described in [Willighagen, E.L.. Internet Journal of Chemistry. 2001. 4].- Author:
- Egon L. Willighagen
- Source code:
- main
- Belongs to CDK module:
- io
- Keywords:
- file format, CML
- Created on:
- 2001-02-01
-
-
Constructor Summary
Constructors Constructor Description EventCMLReader(Reader input, IReaderListener listener, IChemObjectBuilder builder)
Define this CMLReader to take the input from a java.io.Reader class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this IChemObjectIO's resources.IAtomContainer
getAtomContainer()
IResourceFormat
getFormat()
Returns theIResourceFormat
class for this IO class.void
process()
Starts the reading of the CML file.void
setReader(Reader reader)
-
Methods inherited from class org.openscience.cdk.io.iterator.event.DefaultEventChemObjectReader
accepts, accepts, fireFrameRead, remove
-
Methods inherited from class org.openscience.cdk.io.ChemObjectIO
addChemObjectIOListener, addSetting, addSettings, fireIOSettingQuestion, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, 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
-
EventCMLReader
public EventCMLReader(Reader input, IReaderListener listener, IChemObjectBuilder builder)
Define this CMLReader to take the input from a java.io.Reader class. Possible readers are (among others) StringReader and FileReader. The given ReaderListener catches the events thrown to signal that a a new molecule is read.- Parameters:
input
- Reader type inputlistener
- ReaderListener that listens to newMolecule events.
-
-
Method Detail
-
getFormat
public IResourceFormat getFormat()
Description copied from interface:IChemObjectIO
Returns theIResourceFormat
class for this IO class.
-
getAtomContainer
public IAtomContainer getAtomContainer()
-
setReader
public void setReader(Reader reader) throws CDKException
- Throws:
CDKException
-
process
public void process() throws CDKException
Starts the reading of the CML file. Whenever a new Molecule is read, a event is thrown to the ReaderListener.- Throws:
CDKException
-
close
public void close() throws IOException
Description copied from interface:IChemObjectIO
Closes this IChemObjectIO's resources.- Throws:
IOException
- when the wrapper IO class cannot be closed.
-
-