org.openscience.cdk.io.iterator
Class IteratingPCSubstancesXMLReader

java.lang.Object
  extended by org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader
      extended by org.openscience.cdk.io.iterator.IteratingPCSubstancesXMLReader
All Implemented Interfaces:
Iterator, IChemObjectIO, IChemObjectReader, IIteratingChemObjectReader

public class IteratingPCSubstancesXMLReader
extends DefaultIteratingChemObjectReader

Iterating PubChem PC-Substances ASN.1 XML reader.

Author:
Egon Willighagen
Keywords:
file format, ASN, PubChem
Created on:
2008-05-05
Belongs to CDK module:
io
Source code:
HEAD

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openscience.cdk.io.IChemObjectReader
IChemObjectReader.Mode
 
Constructor Summary
IteratingPCSubstancesXMLReader(InputStream in, IChemObjectBuilder builder)
          Constructs a new IteratingPCSubstancesXMLReader that can read Molecule from a given InputStream and IChemObjectBuilder.
IteratingPCSubstancesXMLReader(Reader in, IChemObjectBuilder builder)
          Constructs a new IteratingPCSubstancesXMLReader that can read Molecule from a given Reader and IChemObjectBuilder.
 
Method Summary
 void close()
          Closes this IChemObjectIO's resources.
 IResourceFormat getFormat()
          Returns the IResourceFormat class for this IO class.
 boolean hasNext()
           
 IChemObject next()
           
 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.
 
Methods inherited from class org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader
accepts, addChemObjectIOListener, getIOSettings, handleError, handleError, handleError, handleError, removeChemObjectIOListener, setErrorHandler, setReaderMode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratingPCSubstancesXMLReader

public IteratingPCSubstancesXMLReader(Reader in,
                                      IChemObjectBuilder builder)
                               throws IOException,
                                      org.xmlpull.v1.XmlPullParserException
Constructs a new IteratingPCSubstancesXMLReader that can read Molecule from a given Reader and IChemObjectBuilder.

Parameters:
in - The input stream
builder - The builder
Throws:
IOException - if there is error in getting the IsotopeFactory
org.xmlpull.v1.XmlPullParserException - if there is an error isn setting up the XML parser

IteratingPCSubstancesXMLReader

public IteratingPCSubstancesXMLReader(InputStream in,
                                      IChemObjectBuilder builder)
                               throws Exception
Constructs a new IteratingPCSubstancesXMLReader that can read Molecule from a given InputStream and IChemObjectBuilder.

Parameters:
in - The input stream
builder - The builder. In general, use DefaultChemObjectBuilder
Throws:
Exception - if there is a problem creating an InputStreamReader
Method Detail

getFormat

@TestMethod(value="testGetFormat")
public IResourceFormat getFormat()
Description copied from interface: IChemObjectIO
Returns the IResourceFormat class for this IO class.


hasNext

public boolean hasNext()

next

public IChemObject next()

close

@TestMethod(value="testClose")
public void close()
           throws IOException
Description copied from interface: IChemObjectIO
Closes this IChemObjectIO's resources.

Throws:
IOException

remove

public void remove()
Description copied from class: DefaultIteratingChemObjectReader
File IO generally does not support removing of entries.

Specified by:
remove in interface Iterator
Overrides:
remove in class DefaultIteratingChemObjectReader

setReader

@TestMethod(value="testSetReader_Reader")
public void setReader(Reader reader)
               throws CDKException
Description copied from interface: IChemObjectReader
Sets the Reader from which this ChemObjectReader should read the contents.

Throws:
CDKException

setReader

@TestMethod(value="testSetReader_InputStream")
public void setReader(InputStream reader)
               throws CDKException
Description copied from interface: IChemObjectReader
Sets the InputStream from which this ChemObjectReader should read the contents.

Throws:
CDKException