Class CmsFileIterator
java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.cms.CmsFileIterator
- All Implemented Interfaces:
MsFileIterator
,AutoCloseable
public class CmsFileIterator extends Object implements MsFileIterator
Iterator for a Compomics Mass Spectrometry (cms) file.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors Constructor Description CmsFileIterator(File file, WaitingHandler waitingHandler)
Constructor. -
Method Summary
Modifier and Type Method Description void
close()
Spectrum
getSpectrum()
Returns the spectrum corresponding to the title returned by the last call to the next() method.String
next()
Returns the title of the next spectrum, null if none.
-
Constructor Details
-
CmsFileIterator
Constructor.- Parameters:
file
- The file to iterate.waitingHandler
- The waiting handler.- Throws:
IOException
- Exception thrown if an error occurred while reading the file.
-
-
Method Details
-
next
Description copied from interface:MsFileIterator
Returns the title of the next spectrum, null if none.- Specified by:
next
in interfaceMsFileIterator
- Returns:
- The title of the next spectrum.
-
getSpectrum
Description copied from interface:MsFileIterator
Returns the spectrum corresponding to the title returned by the last call to the next() method.- Specified by:
getSpectrum
in interfaceMsFileIterator
- Returns:
- The spectrum corresponding to the title returned by the last call to the next() method.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceMsFileIterator
-