ambit2.core.io
Class IteratingXLSReader

Package class diagram package IteratingXLSReader
java.lang.Object
  extended by org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader
      extended by ambit2.core.io.IteratingFilesWithHeaderReader
          extended by ambit2.core.io.IteratingXLSReader
All Implemented Interfaces:
java.util.Iterator, org.openscience.cdk.io.IChemObjectIO, org.openscience.cdk.io.iterator.IIteratingChemObjectReader
Direct Known Subclasses:
EurasBCFReader

public class IteratingXLSReader
extends IteratingFilesWithHeaderReader

Reads XLS files. This implementation loads the workbook in memory which is inefficient for big files. TODO find how to read it without loading into memory.


Field Summary
protected  java.io.InputStream input
           
protected  java.util.Iterator iterator
           
protected  org.apache.poi.hssf.usermodel.HSSFSheet sheet
           
protected  org.apache.poi.hssf.usermodel.HSSFWorkbook workbook
           
 
Fields inherited from class ambit2.core.io.IteratingFilesWithHeaderReader
defaultSMILESHeader, logger, numberOfHeaderLines, smilesIndex, sp, timeout
 
Constructor Summary
IteratingXLSReader(java.io.InputStream input, int sheetIndex)
           
 
Method Summary
 void close()
           
 org.openscience.cdk.io.formats.IResourceFormat getFormat()
           
protected  ambit2.base.data.LiteratureEntry getReference()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 void processHeader()
           
protected  void processHeader(org.apache.poi.hssf.usermodel.HSSFRow row)
           
protected  void processRow(org.openscience.cdk.interfaces.IAtomContainer mol)
           
 java.lang.String toString()
           
 
Methods inherited from class ambit2.core.io.IteratingFilesWithHeaderReader
addHeaderColumn, getHeaderColumn, getNumberOfColumns, getNumberOfHeaderLines, getTimeout, isHeaderEmpty, setHeaderColumn, setNumberOfHeaderLines, setTimeout
 
Methods inherited from class org.openscience.cdk.io.iterator.DefaultIteratingChemObjectReader
accepts, addChemObjectIOListener, fireFrameRead, fireIOSettingQuestion, getIOSettings, remove, removeChemObjectIOListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

workbook

protected org.apache.poi.hssf.usermodel.HSSFWorkbook workbook

sheet

protected org.apache.poi.hssf.usermodel.HSSFSheet sheet

iterator

protected java.util.Iterator iterator

input

protected java.io.InputStream input
Constructor Detail

IteratingXLSReader

public IteratingXLSReader(java.io.InputStream input,
                          int sheetIndex)
                   throws ambit2.base.exceptions.AmbitIOException
Throws:
ambit2.base.exceptions.AmbitIOException
Method Detail

getReference

protected ambit2.base.data.LiteratureEntry getReference()
Specified by:
getReference in class IteratingFilesWithHeaderReader

processHeader

public void processHeader()

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

hasNext

public boolean hasNext()

processRow

protected void processRow(org.openscience.cdk.interfaces.IAtomContainer mol)

next

public java.lang.Object next()

processHeader

protected void processHeader(org.apache.poi.hssf.usermodel.HSSFRow row)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFormat

public org.openscience.cdk.io.formats.IResourceFormat getFormat()