@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.
cloneResult, firstId, generateDescriptor, generateId, id, idTagName, lastReadMolecule, mdSet, takeTags
Constructor and Description |
---|
MDArrayReader(MDReader reader)
Constructor from another MDReader.
|
MDArrayReader(MDSet[] elements)
Constructor from standard array (to ease use of methods requiring MDReader input).
|
Modifier and Type | Method and Description |
---|---|
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
|
createMDSetComponent, getCloneResult, getMDSet, getMolecule, setCloneResult, setFirstId, setGenerateId, setIdTagName, setTakeTag
public MDArrayReader(MDSet[] elements)
elements
- Array of MDSets to be put into the reader.public MDArrayReader(MDReader reader) throws MDReaderException
reader
- MDReader to be copied into an array reader.MDReaderException
- if the reader encounter an unreadable record.public void reset() throws MDReaderException
reset
in class MDReader
MDReaderException
- when failed to reset the readerpublic MDSet next() throws MDReaderException
next
in class MDReader
MDReaderException
- when failed reading the next descriptor setpublic int size()
public void close() throws MDReaderException
close
in class MDReader
MDReaderException
- when failed to close the input stream