public class ArrayMDocSource extends MDocSource
MDocSource implementation for an array of documents or molecules.| Constructor and Description |
|---|
ArrayMDocSource(List<?> list)
Creates a document source for a list of documents or molecules.
|
ArrayMDocSource(MDocument[] docs)
Creates a document source for an array of documents.
|
ArrayMDocSource(Molecule[] mols)
Creates a document source for an array of molecules.
|
| Modifier and Type | Method and Description |
|---|---|
int |
estimateNumRecords()
Estimates the total number of records.
|
int |
getRecordCount()
Gets the current record number.
|
int |
getRecordCountMax()
Gets the total number of records.
|
boolean |
isEndReached()
Tests whether the end of input is already reached.
|
boolean |
isRewindable()
Tests whether rewinding (seeking backwards) is possible.
|
MDocument |
nextDoc()
Produces the next document.
|
void |
seekRecord(int k,
MProgressMonitor pmon)
Seeks the specified record.
|
protected void |
seekVisitedRecord(int k)
Seeks an already visited position in case of rewindable input.
|
boolean |
skipRecord()
Skips the next document.
|
close, getDocLabel, getMoleculeIterator, iterator, seekForward, seekRecordAtFraction, skipRecordspublic ArrayMDocSource(List<?> list)
list - the list of documents or moleculespublic ArrayMDocSource(MDocument[] docs)
docs - the array of documentspublic ArrayMDocSource(Molecule[] mols)
mols - the array of moleculespublic MDocument nextDoc()
nextDoc in class MDocSourcepublic boolean skipRecord()
skipRecord in class MDocSourcetrue if the end of the next document is found, false if
there is no chance to continuepublic boolean isRewindable()
isRewindable in class MDocSourcetrue if rewinding is possible, false otherwiseseekRecord(int, MProgressMonitor),
MDocSource.seekRecordAtFraction(double, int, int, int, MProgressMonitor)public void seekRecord(int k,
MProgressMonitor pmon)
seekRecord in class MDocSourcek - positionpmon - progress monitor (unused in this implementation) or nullisRewindable(),
MDocSource.seekRecordAtFraction(double, int, int, int, MProgressMonitor)protected void seekVisitedRecord(int k)
seekVisitedRecord in class MDocSourcek - the record indexpublic boolean isEndReached()
isEndReached in class MDocSourcetrue if the end was reached, false otherwisepublic int getRecordCount()
getRecordCount in class MDocSourcepublic int getRecordCountMax()
getRecordCountMax in class MDocSourcepublic int estimateNumRecords()
estimateNumRecords in class MDocSource