Interface MsFileIterator
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
CmsFileIterator
,MgfFileIterator
,MzmlFileIterator
public interface MsFileIterator extends AutoCloseable
Interface for mass spectrometry file readers.
- Author:
- Marc Vaudel, Harald Barsnes
-
Method Summary
Modifier and Type Method Description void
close()
static MsFileIterator
getMsFileIterator(File file, WaitingHandler waitingHandler)
Returns the file reader for the given mass spectrometry file based on its extension.Spectrum
getSpectrum()
Returns the spectrum corresponding to the title returned by the last call to the next() method.static String[]
getSupportedExtensions()
Returns the supported extensions.String
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:
close
in interfaceAutoCloseable
-
getMsFileIterator
static MsFileIterator getMsFileIterator(File file, WaitingHandler waitingHandler) throws IOExceptionReturns 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.
-