Interface MsFileIterator
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
CmsFileIterator,MgfFileIterator,MzmlFileIterator
Interface for mass spectrometry file readers.
- Author:
- Marc Vaudel, Harald Barsnes
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static MsFileIteratorgetMsFileIterator(File file, WaitingHandler waitingHandler) Returns the file reader for the given mass spectrometry file based on its extension.Returns the spectrum corresponding to the title returned by the last call to the next() method.static String[]Returns the supported extensions.next()Returns the title of the next spectrum, null if none.
-
Method Details
-
next
String next()Returns the title of the next spectrum, null if none.- Returns:
- The title of the next spectrum.
-
getSpectrum
Spectrum getSpectrum()Returns the spectrum corresponding to the title returned by the last call to the next() method.- Returns:
- The spectrum corresponding to the title returned by the last call to the next() method.
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
getMsFileIterator
static MsFileIterator getMsFileIterator(File file, WaitingHandler waitingHandler) throws IOException Returns the file reader for the given mass spectrometry file based on its extension.- Parameters:
file- The mass spectrometry file.waitingHandler- The waiting handler.- Returns:
- The file reader.
- Throws:
IOException- Exception thrown if an error occurred while reading the file.
-
getSupportedExtensions
Returns the supported extensions.- Returns:
- The supported extensions.
-