Package chemaxon.descriptors
Class MDArrayReader
- java.lang.Object
-
- chemaxon.descriptors.MDReader
-
- chemaxon.descriptors.MDArrayReader
-
@PublicAPI 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
-
-
Field Summary
-
Fields inherited from class chemaxon.descriptors.MDReader
cloneResult, firstId, generateDescriptor, generateId, id, idTagName, lastReadMolecule, mdSet, takeTags
-
-
Constructor Summary
Constructors Constructor Description MDArrayReader(MDReader reader)
Constructor from another MDReader.MDArrayReader(MDSet[] elements)
Constructor from standard array (to ease use of methods requiring MDReader input).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the readerMDSet
next()
Gets the next element from reader.void
reset()
Resets the reader to beginningint
size()
Gets number of MDSets in the reader-
Methods inherited from class chemaxon.descriptors.MDReader
createMDSetComponent, getCloneResult, getMDSet, getMolecule, setCloneResult, setFirstId, setGenerateId, setIdTagName, setTakeTag
-
-
-
-
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
- if the reader encounter an unreadable record.
-
-
Method Detail
-
reset
public void reset() throws MDReaderException
Resets the reader to beginning- Overrides:
reset
in classMDReader
- Throws:
MDReaderException
- when failed to reset the reader
-
next
public MDSet next() throws MDReaderException
Gets the next element from reader.- Specified by:
next
in classMDReader
- 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 classMDReader
- Throws:
MDReaderException
- when failed to close the input stream
-
-