|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.io.formats.AbstractMRecordReader
public abstract class AbstractMRecordReader
Abstract record reader class. It is able to read lines and to create line number mappings for the records.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface chemaxon.marvin.io.MRecordReader |
|---|
MRecordReader.Position |
| Constructor Summary | |
|---|---|
AbstractMRecordReader(java.io.InputStream istr,
java.lang.String opts)
Constructs an abstract record reader. |
|
| Method Summary | |
|---|---|
protected void |
appendLine(java.lang.StringBuffer sb,
java.lang.String line)
Appends line to string buffer with closing '\n' character. |
protected void |
appendLines(java.lang.StringBuffer sb,
java.lang.String l)
Appends lines to string buffer with closing '\n' character if it is not yet present. |
void |
close()
Interrupts parsing. |
chemaxon.util.LongVector |
detectRecordPositions(chemaxon.util.IntVector linenums)
Detects positions of records in the input stream. |
protected int[] |
endRecord(boolean skip)
It must be called at the end of record. |
MRecordReader |
getEncapsulatedReader()
Gets the encapsulated record reader if it exists. |
long |
getFilePointer()
Get the file pointer. |
java.lang.String |
getFooterAsString()
Gets the footer of the file as a string. |
java.lang.String |
getHeaderAsString()
Gets the header of the file as a string. |
int |
getLineCount()
Get the current line number. |
MolInputStream |
getMolInputStream()
Gets the molecule input stream. |
java.lang.String |
getOptions()
Gets the import options. |
protected MRecordReader.Position |
getPosition()
Gets the current position. |
java.lang.String |
getRecognizedFormat()
Gets the recognized file format. |
boolean |
isPropertyRecord()
|
boolean |
isSeekable()
Tests whether the record reader is seekable. |
protected void |
putBackLine()
Puts back the previous line to the input stream. |
protected java.lang.String |
readLine()
Reads the next line. |
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 |
setProgressMonitor(MProgressMonitor pmon)
Sets the progress monitor. |
protected boolean |
skipLine()
Skips the next line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface chemaxon.marvin.io.MRecordReader |
|---|
nextRecord, skipRecord |
| Constructor Detail |
|---|
public AbstractMRecordReader(java.io.InputStream istr,
java.lang.String opts)
throws java.io.IOException
istr - the input streamopts - format and options
java.io.IOException| Method Detail |
|---|
public void setProgressMonitor(MProgressMonitor pmon)
setProgressMonitor in interface MRecordReaderpmon - the progress monitorpublic java.lang.String getRecognizedFormat()
getRecognizedFormat in interface MRecordReaderpublic java.lang.String getHeaderAsString()
getHeaderAsString in interface MRecordReaderpublic java.lang.String getFooterAsString()
getFooterAsString in interface MRecordReaderpublic java.lang.String getOptions()
getOptions in interface MRecordReader
protected java.lang.String readLine()
throws java.io.IOException
java.io.IOException
protected boolean skipLine()
throws java.io.IOException
true if a line was skipped successfully,
false at end of file
java.io.IOException - If an I/O error has occurred.
protected void putBackLine()
throws java.io.IOException
java.io.IOExceptionprotected int[] endRecord(boolean skip)
skip - whether to skip the record
public void close()
close in interface MRecordReaderpublic MRecordReader getEncapsulatedReader()
getEncapsulatedReader in interface MRecordReadernullpublic MolInputStream getMolInputStream()
getMolInputStream in interface MRecordReaderpublic long getFilePointer()
getFilePointer in interface MRecordReaderpublic int getLineCount()
getLineCount in interface MRecordReaderpublic boolean isSeekable()
isSeekable in interface MRecordReadertrue if it is seekable,
false otherwise
public void seek(long p,
int lcount,
int k)
throws java.io.IOException
seek in interface MRecordReaderp - the file pointerlcount - the line count at the specified positionk - the record count at the specified position
java.io.IOException - if pos is less than
0 or if an I/O error occurs.protected MRecordReader.Position getPosition()
protected void appendLines(java.lang.StringBuffer sb,
java.lang.String l)
sb - the string bufferl - the lines
protected void appendLine(java.lang.StringBuffer sb,
java.lang.String line)
sb - the string bufferline - the linepublic boolean isPropertyRecord()
isPropertyRecord in interface MRecordReader
public chemaxon.util.LongVector detectRecordPositions(chemaxon.util.IntVector linenums)
throws MolFormatException
detectRecordPositions in interface MRecordReaderlinenums - If not null, stores start line numbers of records
in this container.
MolFormatException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||