org.openscience.cdk.io
Interface IChemObjectReader

All Superinterfaces:
Closeable, IChemObjectIO
All Known Subinterfaces:
IIteratingChemObjectReader<T>, ISimpleChemObjectReader
All Known Implementing Classes:
CDKOWLReader, CIFReader, CMLReader, CrystClustReader, CTXReader, DefaultChemObjectReader, DefaultIteratingChemObjectReader, GamessReader, Gaussian03Reader, Gaussian98Reader, GhemicalMMReader, HINReader, INChIPlainTextReader, INChIReader, IteratingPCCompoundASNReader, IteratingPCCompoundXMLReader, IteratingPCSubstancesXMLReader, IteratingSDFReader, IteratingSMILESReader, MDLReader, MDLRXNReader, MDLRXNV2000Reader, MDLRXNV3000Reader, MDLV2000Reader, MDLV3000Reader, Mol2Reader, Mopac7Reader, MoSSOutputReader, PCCompoundASNReader, PCCompoundXMLReader, PCSubstanceXMLReader, PDBReader, PMPReader, RGroupQueryReader, ShelXReader, SMILESReader, VASPReader, XYZReader, ZMatrixReader

public interface IChemObjectReader
extends IChemObjectIO

This interface specifies the common functionality all IO readers should provide. IO readers should not implement this interface directly, but rather implement one of its child interfaces: ISimpleChemObjectReader or IIteratingChemObjectReader. These sub-interfaces specify the information access methods: a simple read() method for the ISimpleChemObjectReader and more advanced iterator based access for the IIteratingChemObjectReader (suitable for large files)

Author:
Egon Willighagen
See Also:
ISimpleChemObjectReader, IIteratingChemObjectReader
Belongs to CDK module:
io
Source code:
cdk-1.4.x

Nested Class Summary
static class IChemObjectReader.Mode
           
 
Method Summary
 void handleError(String message)
          Redirects an error message to the IChemObjectReaderErrorHandler.
 void handleError(String message, Exception exception)
          Redirects an error message to the IChemObjectReaderErrorHandler.
 void handleError(String message, int row, int colStart, int colEnd)
          Redirects an error message to the IChemObjectReaderErrorHandler.
 void handleError(String message, int row, int colStart, int colEnd, Exception exception)
          Redirects an error message to the IChemObjectReaderErrorHandler.
 void setErrorHandler(IChemObjectReaderErrorHandler handler)
          Sets an error handler that is sent events when file format issues occur.
 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 setReaderMode(IChemObjectReader.Mode mode)
          Sets the reader mode.
 
Methods inherited from interface org.openscience.cdk.io.IChemObjectIO
accepts, addChemObjectIOListener, addSetting, addSettings, close, getFormat, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
 

Method Detail

setReader

void setReader(Reader reader)
               throws CDKException
Sets the Reader from which this ChemObjectReader should read the contents.

Throws:
CDKException

setReader

void setReader(InputStream reader)
               throws CDKException
Sets the InputStream from which this ChemObjectReader should read the contents.

Throws:
CDKException

setReaderMode

void setReaderMode(IChemObjectReader.Mode mode)
Sets the reader mode. If Mode.STRICT, then the reader will fail on any problem in the format of the read file, instead of trying to recover from that.

Parameters:
mode -

setErrorHandler

void setErrorHandler(IChemObjectReaderErrorHandler handler)
Sets an error handler that is sent events when file format issues occur.

Parameters:
handler - IChemObjectReaderErrorHandler to send error messages to.

handleError

void handleError(String message)
                 throws CDKException
Redirects an error message to the IChemObjectReaderErrorHandler. Throws an CDKException when in STRICT IChemObjectReader.Mode.

Parameters:
message - the error message.
Throws:
CDKException

handleError

void handleError(String message,
                 Exception exception)
                 throws CDKException
Redirects an error message to the IChemObjectReaderErrorHandler. Throws an CDKException when in STRICT IChemObjectReader.Mode.

Parameters:
message - the error message.
exception - the corresponding Exception.
Throws:
CDKException

handleError

void handleError(String message,
                 int row,
                 int colStart,
                 int colEnd)
                 throws CDKException
Redirects an error message to the IChemObjectReaderErrorHandler. Throws an CDKException when in STRICT IChemObjectReader.Mode.

Parameters:
message - the error message.
row - Row in the file where the error is found.
colStart - Start column in the file where the error is found.
colEnd - End column in the file where the error is found.
Throws:
CDKException

handleError

void handleError(String message,
                 int row,
                 int colStart,
                 int colEnd,
                 Exception exception)
                 throws CDKException
Redirects an error message to the IChemObjectReaderErrorHandler. Throws an CDKException when in STRICT IChemObjectReader.Mode.

Parameters:
message - the error message.
exception - the corresponding Exception.
row - Row in the file where the error is found.
colStart - Start column in the file where the error is found.
colEnd - End column in the file where the error is found.
Throws:
CDKException