@Test public void parseWholeFile() throws Exception { for (Path p : paths) { System.out.printf("\n\nParsing whole file: %s\n", p.getFileName()); final MZXMLFile mzxml = new MZXMLFile(p.toString()); mzxml.setNumThreadsForParsing(null); mzxml.setTasksPerCpuPerBatch(1); mzxml.setParsingTimeout(30 * 1000); final MZXMLIndex index = mzxml.fetchIndex(); IScanCollection scans = new ScanCollectionDefault(true); scans.setDataSource(mzxml); scans.loadData(LCMSDataSubset.STRUCTURE_ONLY, StorageStrategy.STRONG); System.out.printf("\tFound/parsed %d spectra\n", scans.getMapNum2scan().size()); } }
@Override public MZXMLIndex fetchIndex() throws FileParsingException { MZXMLIndex tmp = index; if (tmp == null) { synchronized (this) { tmp = getIndex(); if (tmp == null) { tmp = parseIndex(); index = tmp; } } } return tmp; }
MZXMLFile extends AbstractXMLBasedDataSource<MZXMLIndexElement, MZXMLIndex> { @Override public MZXMLIndex fetchIndex() throws FileParsingException { MZXMLIndex tmp = index; if (tmp == null) { synchronized (this) { tmp = getIndex(); if (tmp == null) { tmp = parseIndex(); index = tmp; } } } return tmp; } }
MZXMLFile extends AbstractXMLBasedDataSource<MZXMLIndexElement, MZXMLIndex> { @Override public MZXMLIndex fetchIndex() throws FileParsingException { MZXMLIndex tmp = index; if (tmp == null) { synchronized (this) { tmp = getIndex(); if (tmp == null) { tmp = parseIndex(); index = tmp; } } } return tmp; } MZXMLFile(String path);  MZXMLFile(String path, boolean excludeEmptyScans); }
MZXMLFile extends AbstractXMLBasedDataSource<MZXMLIndexElement, MZXMLIndex> { @Override public MZXMLIndex fetchIndex() throws FileParsingException { MZXMLIndex tmp = index; if (tmp == null) { synchronized (this) { tmp = getIndex(); if (tmp == null) { tmp = parseIndex(); index = tmp; } } } return tmp; } MZXMLFile(String path);  MZXMLFile(String path, boolean excludeEmptyScans); ObjectPool<XMLStreamReaderImpl> getReaderPool(); @Override MZXMLIndex getIndex(); @Override MZXMLIndex parseIndex(); @Override MZXMLIndex fetchIndex(); @Override LCMSRunInfo parseRunInfo(); @Override MZXMLMultiSpectraParser getSpectraParser(InputStream inputStream,
      LCMSDataSubset subset, ObjectPool<XMLStreamReaderImpl> readerPool, Integer numSpectra); @Override IndexBuilder<MZXMLIndexElement> getIndexBuilder(IndexBuilder.Info info); }
MZXMLFile extends AbstractXMLBasedDataSource<MZXMLIndexElement, MZXMLIndex> { @Override public MZXMLIndex fetchIndex() throws FileParsingException { MZXMLIndex tmp = index; if (tmp == null) { synchronized (this) { tmp = getIndex(); if (tmp == null) { tmp = parseIndex(); index = tmp; } } } return tmp; } MZXMLFile(String path);  MZXMLFile(String path, boolean excludeEmptyScans); ObjectPool<XMLStreamReaderImpl> getReaderPool(); @Override MZXMLIndex getIndex(); @Override MZXMLIndex parseIndex(); @Override MZXMLIndex fetchIndex(); @Override LCMSRunInfo parseRunInfo(); @Override MZXMLMultiSpectraParser getSpectraParser(InputStream inputStream,
      LCMSDataSubset subset, ObjectPool<XMLStreamReaderImpl> readerPool, Integer numSpectra); @Override IndexBuilder<MZXMLIndexElement> getIndexBuilder(IndexBuilder.Info info);  }