SimpleMsScan extends AbstractMsSpectrum implements MsScan { public void setRawDataFile(@Nonnull RawDataFile newRawDataFile) { if ((this.dataFile != null) && (this.dataFile != newRawDataFile)) { throw new MSDKRuntimeException( "Cannot set the raw data file reference to this scan, because it has already been set"); } this.dataFile = newRawDataFile; } SimpleMsScan(@Nonnull Integer scanNumber);  SimpleMsScan(@Nonnull Integer scanNumber, String msFunction); @Override @Nullable RawDataFile getRawDataFile(); void setRawDataFile(@Nonnull RawDataFile newRawDataFile); @Override @Nonnull Integer getScanNumber(); void setScanNumber(@Nonnull Integer scanNumber); @Override @Nullable String getScanDefinition(); void setScanDefinition(@Nullable String scanDefinition); @Override @Nullable String getMsFunction(); void setMsFunction(@Nullable String newFunction); @Override @Nullable Integer getMsLevel(); void setMsLevel(@Nonnull Integer msLevel); @Override @Nullable Range<Double> getScanningRange(); void setScanningRange(@Nullable Range<Double> newScanRange); @Override @Nonnull PolarityType getPolarity(); void setPolarity(@Nonnull PolarityType newPolarity); @Override @Nonnull MsScanType getMsScanType(); void setMsScanType(@Nonnull MsScanType newMsScanType); @Override MzTolerance getMzTolerance(); void setMzTolerance(MzTolerance mzTolerance); @Override @Nullable Float getRetentionTime(); void setRetentionTime(@Nullable Float rt); @Override @Nullable ActivationInfo getSourceInducedFragmentation(); void setSourceInducedFragmentation(@Nullable ActivationInfo newFragmentationInfo); @Override @Nonnull List<IsolationInfo> getIsolations();  }
@Test public void testSetRawDataFile() throws MSDKException { RawDataFile rdf = new SimpleRawDataFile("test", null, FileType.UNKNOWN); SimpleMsScan scan = new SimpleMsScan(1); scan.setRawDataFile(rdf); Assert.assertEquals(rdf, scan.getRawDataFile()); }
@Test(expected = MSDKRuntimeException.class) public void testSetRawDataFileFail() throws MSDKException { RawDataFile rdf = new SimpleRawDataFile("test", null, FileType.UNKNOWN); RawDataFile rdf2 = new SimpleRawDataFile("test2", null, FileType.UNKNOWN); SimpleMsScan scan = new SimpleMsScan(1); scan.setRawDataFile(rdf); scan.setRawDataFile(rdf2); }