Package chemaxon.marvin.plugin
Class PluginMDocSource
java.lang.Object
chemaxon.marvin.io.MDocSource
chemaxon.marvin.plugin.PluginMDocSource
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<Molecule>
- Since:
- Marvin 5.0, 02/22/2007
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintEstimates the total number of records.intGets the current record number.intGets the total number of records.booleanTests whether the end of input is already reached.booleanTests whether rewinding (seeking backwards) is possible.voidlimitRecordCount(int limit) Limits the number of result docs.nextDoc()Produces the next document.voidseekRecord(int k, MProgressMonitor pmon) Seeks the specified record.protected voidseekVisitedRecord(int k) Seeks an already visited position in case of rewindable input.booleanSkips the next document.Methods inherited from class chemaxon.marvin.io.MDocSource
close, getDocLabel, getMDocumentStream, getMoleculeIterator, getMolStream, iterator, seekForward, seekRecordAtFraction, skipRecordsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PluginMDocSource
Constructor. Sets the enumerator.- Parameters:
iterator- the document iteratormaxCount- the number of result docs
-
-
Method Details
-
limitRecordCount
public void limitRecordCount(int limit) Limits the number of result docs.- Parameters:
limit- the max number of result docs
-
nextDoc
Produces the next document.- Specified by:
nextDocin classMDocSource- Returns:
- the document or null at end of file
- Throws:
IOException- If I/O error occurred
-
skipRecord
Skips the next document.- Specified by:
skipRecordin classMDocSource- Returns:
trueif the end of the next document is found,falseif there is no chance to continue- Throws:
IOException- If I/O error occurred
-
isRewindable
public boolean isRewindable()Tests whether rewinding (seeking backwards) is possible.- Specified by:
isRewindablein classMDocSource- Returns:
false- See Also:
-
seekRecord
Description copied from class:MDocSourceSeeks the specified record. 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 usercancelsthe progress dialog.- Specified by:
seekRecordin classMDocSource- Parameters:
k- positionpmon- progress monitor ornull- Throws:
IOException- if read error occurred- See Also:
-
seekVisitedRecord
Description copied from class:MDocSourceSeeks an already visited position in case of rewindable input.- Specified by:
seekVisitedRecordin classMDocSource- Parameters:
k- the record index- Throws:
IOException- if read error occurred
-
isEndReached
public boolean isEndReached()Tests whether the end of input is already reached.- Specified by:
isEndReachedin classMDocSource- Returns:
trueif the end was reached,falseotherwise
-
getRecordCount
public int getRecordCount()Gets the current record number.- Specified by:
getRecordCountin classMDocSource- Returns:
- the record number
-
getRecordCountMax
public int getRecordCountMax()Gets the total number of records.- Specified by:
getRecordCountMaxin classMDocSource- Returns:
- the number of records
-
estimateNumRecords
public int estimateNumRecords()Estimates the total number of records.- Specified by:
estimateNumRecordsin classMDocSource- Returns:
- estimated number of records or -1
-