/** * Initiate the MolecularFormulaGenerator. * * @param minMass * Lower boundary of the target mass range * @param maxMass * Upper boundary of the target mass range * @param mfRange * A range of elemental compositions defining the search space * @throws IllegalArgumentException * In case some of the isotopes in mfRange has undefined exact * mass or in case illegal parameters are provided (e.g., * negative mass values or empty MolecularFormulaRange) * @see MolecularFormulaRange */ RoundRobinFormulaGenerator(final IChemObjectBuilder builder, final double minMass, final double maxMass, final MolecularFormulaRange mfRange) { this.builder = builder; final List<IIsotope> isotopes = new ArrayList<>(mfRange.getIsotopeCount()); for (IIsotope iso : mfRange.isotopes()) { if (mfRange.getIsotopeCountMin(iso) >= 0 && mfRange.getIsotopeCountMax(iso) > 0) isotopes.add(iso); } this.decomposer = DecomposerFactory.getInstance().getDecomposerFor(isotopes.toArray(new IIsotope[isotopes.size()])).decomposeIterator(minMass, maxMass, mfRange); this.done = false; this.mfRange = mfRange; }