chemaxon.descriptors
Class MDArrayReader

java.lang.Object
  extended by chemaxon.descriptors.MDReader
      extended by chemaxon.descriptors.MDArrayReader

public class MDArrayReader
extends MDReader

Reads MolecularDescriptors from an array. Intended for use when chemical descriptors are read more than once.

Typical usage:

 MDArrayReader r = new MDArrayReader( sampleDescriptorSet, cdFileReader );
 

After that all methods of MDReaders can be called, the number of MDSets is known, reading is fast, and can be reset without problems.

Since:
JChem 2.0
Author:
Zsuzsanna Szabo

Field Summary
 
Fields inherited from class chemaxon.descriptors.MDReader
cloneResult, firstId, generateDescriptor, generateId, id, idTagName, lastReadMolecule, mdSet, takeTags
 
Constructor Summary
MDArrayReader(MDReader reader)
          Constructor from another MDReader.
MDArrayReader(MDSet[] elements)
          Constructor from standard array (to ease use of methods requiring MDReader input).
 
Method Summary
 void close()
          Closes the reader
 MDSet next()
          Gets the next element from reader.
 void reset()
          Resets the reader to beginning
 int size()
          Gets number of MDSets in the reader
 
Methods inherited from class chemaxon.descriptors.MDReader
createMDSetComponent, getCloneResult, getMDSet, getMolecule, setCloneResult, setFirstId, setGenerateId, setIdTagName, setTakeTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDArrayReader

public MDArrayReader(MDSet[] elements)
Constructor from standard array (to ease use of methods requiring MDReader input).

Parameters:
elements - Array of MDSets to be put into the reader.

MDArrayReader

public MDArrayReader(MDReader reader)
              throws MDReaderException
Constructor from another MDReader.

Parameters:
reader - MDReader to be copied into an array reader.
Throws:
MDReaderException
Method Detail

reset

public void reset()
           throws MDReaderException
Resets the reader to beginning

Overrides:
reset in class MDReader
Throws:
MDReaderException - when failed to reset the reader

next

public MDSet next()
           throws MDReaderException
Gets the next element from reader.

Specified by:
next in class MDReader
Returns:
Next element or null if no more elements
Throws:
MDReaderException - when failed reading the next descriptor set

size

public int size()
Gets number of MDSets in the reader

Returns:
number of MDSets in the reader

close

public void close()
           throws MDReaderException
Closes the reader

Specified by:
close in class MDReader
Throws:
MDReaderException - when failed to close the input stream