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, skipRecords
public 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 MDocSource
public boolean skipRecord()
skipRecord
in class MDocSource
true
if the end of the next document is found, false
if
there is no chance to continuepublic boolean isRewindable()
isRewindable
in class MDocSource
true
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 MDocSource
k
- positionpmon
- progress monitor (unused in this implementation) or null
isRewindable()
,
MDocSource.seekRecordAtFraction(double, int, int, int, MProgressMonitor)
protected void seekVisitedRecord(int k)
seekVisitedRecord
in class MDocSource
k
- the record indexpublic boolean isEndReached()
isEndReached
in class MDocSource
true
if the end was reached, false
otherwisepublic int getRecordCount()
getRecordCount
in class MDocSource
public int getRecordCountMax()
getRecordCountMax
in class MDocSource
public int estimateNumRecords()
estimateNumRecords
in class MDocSource