|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.descriptors.MDReader
chemaxon.descriptors.MDFileReader
public class MDFileReader
Reads MDSet objects from a text file. The input text file can
either be a molecular structure file (for example SDfile, MOL file etc.) or
it can be a molecular descriptor file written by MDFileWriter.
In both cases an MDSet object created by the client of this
class is build and returned by the reader methods.
The two kinds of operation requires two different ways to create the
MDFileReader object, see appropriate constructors.
| Field Summary |
|---|
| Fields inherited from class chemaxon.descriptors.MDReader |
|---|
cloneResult, firstId, generateDescriptor, generateId, id, idTagName, lastReadMolecule, mdSet, takeTags |
| Constructor Summary | |
|---|---|
MDFileReader(java.io.InputStream inputFile,
MDSet mdSet)
Creates and intializes a file reader that reads a molecular structure file. |
|
MDFileReader(java.lang.String inputFileName)
Creates and initialises a MDSet file reader for reading
one single MolecularDescriptor. |
|
MDFileReader(java.lang.String[] inputFileNames)
Creates and initialises an MDSet file reader for reading
multiple MolecularDescriptor components. |
|
MDFileReader(java.lang.String inputFileName,
MDSet mdSet)
Creates and intializes a file reader that reads a molecular structure file. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the reader. |
Molecule |
getMolecule()
Gets the current molecular structure as read from the input file (that is before any transformation were applied). |
MDSet |
next()
Reads the next MDSet object from the input source. |
void |
reset()
Resets the stream. |
void |
setKeepOriginalMolecule(boolean keep)
Sets if original molecule, as read from the input file, has to be saved or not. |
| Methods inherited from class chemaxon.descriptors.MDReader |
|---|
createMDSetComponent, getCloneResult, getMDSet, 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 |
|---|
public MDFileReader(java.lang.String inputFileName)
throws chemaxon.descriptors.MDReaderException
MDSet file reader for reading
one single MolecularDescriptor. This works for descriptor
files written by MDFileWriter.
inputFileName - name of the descriptor input file
chemaxon.descriptors.MDReaderException
public MDFileReader(java.lang.String[] inputFileNames)
throws chemaxon.descriptors.MDReaderException
MDSet file reader for reading
multiple MolecularDescriptor components.
inputFileNames - input file names
chemaxon.descriptors.MDReaderException
public MDFileReader(java.lang.String inputFileName,
MDSet mdSet)
throws chemaxon.descriptors.MDReaderException
MDSet template has to be provided in this constructor. This
has to be properly initialized (apparently, by default constructors) as
this specifies what kind of descriptors are read from the molecule file.
inputFileName - name of the input molecular structure filemdSet - sample Molecular Descriptor Set
chemaxon.descriptors.MDReaderException
public MDFileReader(java.io.InputStream inputFile,
MDSet mdSet)
throws chemaxon.descriptors.MDReaderException
MDSet template has to be provided in this constructor. This
has to be properly initialized (apparently, by default constructors) as
this specifies what kind of descriptors are read from the molecule file.
inputFile - input molecular structure filemdSet - sample Molecular Descriptor Set
chemaxon.descriptors.MDReaderException| Method Detail |
|---|
public void setKeepOriginalMolecule(boolean keep)
MolecularDescriptor transforms the original structure.
The opriginal molecule can be retrieved by getMolecule().
This method is applicable only if the input file is a molecular structure
file.
keep - indicates if the original structure has to be preserved
or not
public Molecule getMolecule()
throws chemaxon.descriptors.MDReaderException
MDReader
subclasses can implement this method in a meaningful way, therefore it is
not an abstract method (just for the sake of ease).
getMolecule in class MDReaderchemaxon.descriptors.MDReaderException
public void reset()
throws chemaxon.descriptors.MDReaderException
next( MDSet cds )
after reset() reads the first line of the input stream.
reset in class MDReaderchemaxon.descriptors.MDReaderException - when failed to reset the reader
public MDSet next()
throws chemaxon.descriptors.MDReaderException
MDSet object from the input source. The
returned object is either reused or always a new instance is created
depending on setCloneResult() settings.
next in class MDReaderchemaxon.descriptors.MDReaderException - when file is corrupt
public void close()
throws chemaxon.descriptors.MDReaderException
close in class MDReaderchemaxon.descriptors.MDReaderException - i/o errors are reinterpreted
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||