|
|||||||||
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 | |
---|---|
void |
close()
Closes the underlying input stream(s). |
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. |
java.util.Iterator<Molecule> |
iterator()
Gets a molecule iterator for this document source. |
abstract MDocument |
nextDoc()
Produces the next document. |
int |
seekForward(int k,
chemaxon.common.util.MProgressMonitor pmon,
int dt,
java.lang.Runnable sizeupdater)
Seeks in forward direction. |
abstract void |
seekRecord(int k,
chemaxon.common.util.MProgressMonitor pmon)
Seeks the specified record. |
void |
seekRecordAtFraction(double q,
int start,
int n,
int ncols,
chemaxon.common.util.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,
chemaxon.common.util.MProgressMonitor pmon,
int dt,
java.lang.Runnable sizeupdater)
|
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 occuredpublic void close() throws java.io.IOException
java.io.IOException
- If an I/O error has occurred.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, chemaxon.common.util.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, chemaxon.common.util.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 occuredpublic final int seekForward(int k, chemaxon.common.util.MProgressMonitor pmon, int dt, java.lang.Runnable sizeupdater) throws java.io.IOException
k
- the record to seekpmon
- the progress monitordt
- time interval in milliseconds for calling size
updatesizeupdater
- optional runnable to be called if the total number
of records changed or null
java.io.IOException
- if read error occuredseekRecordAtFraction(double, int, int, int, MProgressMonitor)
,
seekVisitedRecord(int)
protected final int skipRecords(int start, int end, chemaxon.common.util.MProgressMonitor pmon, int dt, java.lang.Runnable sizeupdater) throws java.io.IOException
java.io.IOException
public abstract boolean isEndReached()
true
if the end was reached,
false
otherwisepublic abstract int getRecordCount()
public abstract int getRecordCountMax()
public abstract int estimateNumRecords()
public java.util.Iterator<Molecule> iterator()
iterator
in interface java.lang.Iterable<Molecule>
java.lang.UnsupportedOperationException
- if an iterator was created beforepublic final MoleculeIterator getMoleculeIterator()
java.lang.UnsupportedOperationException
- if an iterator was created before
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |