|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.io.MDocSource
public abstract class MDocSource
Marvin document source.
| Constructor Summary | |
|---|---|
MDocSource()
|
|
| Method Summary | |
|---|---|
abstract int |
estimateNumRecords()
Estimates the total number of records. |
java.lang.String |
getDocLabel(int k,
MDocument doc)
Returns the display label for the given document and document index. |
MoleculeIterator |
getMoleculeIterator()
Gets a molecule iterator for this document source. |
abstract int |
getRecordCount()
Gets the current record number. |
abstract int |
getRecordCountMax()
Gets the total number of records. |
abstract boolean |
isEndReached()
Tests whether the end of input is already reached. |
abstract boolean |
isRewindable()
Tests whether rewinding (seeking backwards) is possible. |
abstract MDocument |
nextDoc()
Produces the next document. |
protected int |
seekForward(int k,
MProgressMonitor pmon)
Seeks in forward direction. |
abstract void |
seekRecord(int k,
MProgressMonitor pmon)
Seeks the specified record. |
void |
seekRecordAtFraction(double q,
int start,
int n,
int ncols,
MProgressMonitor pmon)
Seeks an approximate file position. |
protected abstract void |
seekVisitedRecord(int k)
Seeks an already visited position in case of rewindable input. |
abstract boolean |
skipRecord()
Skips the next document. |
protected int |
skipRecords(int start,
int end,
MProgressMonitor pmon)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MDocSource()
| Method Detail |
|---|
public abstract MDocument nextDoc()
throws java.io.IOException
java.io.IOException - If I/O error occured
public java.lang.String getDocLabel(int k,
MDocument doc)
k+1 as String,
where k is the document index.
k - the document indexdoc - the document
public abstract boolean skipRecord()
throws java.io.IOException
true if the end of the next document is found,
false if there is no chance to continue
java.io.IOException - If I/O error occuredpublic abstract boolean isRewindable()
true if rewinding is possible,
false otherwiseseekRecord(int, MProgressMonitor),
seekRecordAtFraction(double, int, int, int, MProgressMonitor)
public abstract void seekRecord(int k,
MProgressMonitor pmon)
throws java.io.EOFException,
java.io.IOException
cancels the progress dialog.
k - positionpmon - progress monitor or null
java.io.EOFException - if end of file reached while trying to seek
java.io.IOException - if read error occuredisRewindable(),
seekRecordAtFraction(double, int, int, int, MProgressMonitor)
public final void seekRecordAtFraction(double q,
int start,
int n,
int ncols,
MProgressMonitor pmon)
throws java.io.IOException
x = 0 or 1, respectively.
If records correspond to rows and columns of a table and the
ncols argument differs from 1, then seeking is
restricted to the first column.
Backward seeking (rewinding) in the stream is only possible if the
underlying input stream is seekable. Forward seeking is always
possible.
Seeking terminates before reaching the specified position if the
user cancels the progress dialog.
q - the position divided by the file size,
0 is the start, 1 is the end of filestart - the minimum record index (offset)n - the total number of available records
or 0 if all records are availablencols - the number of columns (1 if there are no more columns)pmon - progress monitor or null
java.io.IOException - if read error occuredisRewindable(),
seekRecord(int, MProgressMonitor)
protected abstract void seekVisitedRecord(int k)
throws java.io.IOException
k - the record index
java.io.IOException - if read error occured
protected final int seekForward(int k,
MProgressMonitor pmon)
throws java.io.IOException
k - the record to seek
java.io.IOException - if read error occuredseekRecordAtFraction(double, int, int, int, MProgressMonitor),
seekVisitedRecord(int)
protected final int skipRecords(int start,
int end,
MProgressMonitor pmon)
throws java.io.IOException
java.io.IOExceptionpublic abstract boolean isEndReached()
true if the end was reached,
false otherwisepublic abstract int getRecordCount()
public abstract int getRecordCountMax()
public abstract int estimateNumRecords()
public final MoleculeIterator getMoleculeIterator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||