Package chemaxon.marvin.io
Interface MRecordReader
- All Known Implementing Classes:
AbstractMRecordReader
Marvin record reader.
- Since:
- Marvin 5.0, 04/06/2006
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Position in the input file. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the input stream.chemaxon.common.util.LongVector
detectRecordPositions
(chemaxon.common.util.IntVector linenums) Deprecated.Gets the encapsulated record reader if it exists.long
Gets the current position in the input file.Gets the footer of the file as a string.Gets the header of the file as a string.int
Get the current line number.Gets the molecule input stream.Gets the import options.Gets the recognized file format.boolean
boolean
Tests whether the record reader is seekable.Reads the next record.void
seek
(long p, int lcount, int k) Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.void
Sets the progress monitor.Skips the next record.
-
Method Details
-
setProgressMonitor
Sets the progress monitor.- Parameters:
pmon
- the progress monitor
-
nextRecord
Reads the next record.- Returns:
- the record or null at end of file
- Throws:
MRecordParseException
- If the record could not be parsedIOException
- If I/O error occurred
-
skipRecord
Skips the next record.- Returns:
- incomplete record information, only the record start and end positions are guaranteed to be set
- Throws:
MRecordParseException
- If the record could not be parsedIOException
- If I/O error occurred
-
getRecognizedFormat
String getRecognizedFormat()Gets the recognized file format.- Returns:
- the input file format
-
getHeaderAsString
String getHeaderAsString()Gets the header of the file as a string.- Returns:
- the header or empty string if there is no header
- Since:
- Marvin 5.0.2, 03/11/2008
-
getOptions
String getOptions()Gets the import options.- Returns:
- the import options
-
close
Closes the input stream.- Throws:
IOException
- If I/O error occurred
-
getEncapsulatedReader
MRecordReader getEncapsulatedReader()Gets the encapsulated record reader if it exists. For example, in case of a GZIPped, BASE64 encoded molfile, the GzipRecordReader has an encapsulated Base64RecordReader instance.- Returns:
- the encapsulated record reader or
null
-
getMolInputStream
MolInputStream getMolInputStream()Gets the molecule input stream.- Returns:
- the molecule input stream
-
getFilePointer
long getFilePointer()Gets the current position in the input file.- Returns:
- the position
-
getLineCount
int getLineCount()Get the current line number.- Returns:
- the line number
-
isSeekable
boolean isSeekable()Tests whether the record reader is seekable.- Returns:
true
if it is seekable,false
otherwise
-
seek
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.- Parameters:
p
- the file pointerlcount
- the line count at the specified positionk
- the record count at the specified position- Throws:
IOException
- ifpos
is less than0
or if an I/O error occurs.
-
isPropertyRecord
boolean isPropertyRecord() -
detectRecordPositions
@Deprecated @SubjectToRemoval(date=JUL_01_2025) chemaxon.common.util.LongVector detectRecordPositions(chemaxon.common.util.IntVector linenums) throws MolFormatException Deprecated.Detects positions of records in the input stream. Optionally returns also with the line number of records.- Parameters:
linenums
- If not null, stores start line numbers of records in this container.- Returns:
- container with start and end positions of records (inpair elements describe starting, pairs the ending positions).
- Throws:
MolFormatException
-