Adds all molecularFormulas in the AdductFormula to this chemObject.

@param  formulaSet  The MolecularFormulaSet
966260
@Override
    public void add(IMolecularFormulaSet formulaSet) {

        for (IMolecularFormula mf : formulaSet.molecularFormulas()) {
            addMolecularFormula(mf);
        }
    }
378837
public static void clearMajorIsotopes(IMolecularFormula formula) {
        for (IIsotope iso : FluentIterable.from(formula.isotopes()).toList())
            if (isMajor(iso)) {
                int count = formula.getIsotopeCount(iso);
                formula.removeIsotope(iso);
                iso.setMassNumber(null);
                // may be immutable
                if (iso.getMassNumber() != null) {
                    iso = formula.getBuilder().newInstance(IIsotope.class, iso.getSymbol());
                    iso.setAtomicNumber(iso.getAtomicNumber());
                }
                iso.setExactMass(null);
                iso.setNaturalAbundance(null);
                formula.addIsotope(iso, count);
            }
    }
653556
public static IReactionScheme createReactionScheme(IReactionSet reactionSet) {
        IReactionScheme reactionScheme = reactionSet.getBuilder().newInstance(IReactionScheme.class);

        // Looking for those reactants which doesn't have any precursor. They are the top.
        ArrayList<IReaction> listTopR = new ArrayList<IReaction>();
        for (IReaction reaction : reactionSet.reactions()) {
            if (extractPrecursorReaction(reaction, reactionSet).getReactionCount() == 0) listTopR.add(reaction);
        }

        for (IReaction reaction : listTopR) {
            reactionScheme.addReaction(reaction);
            IReactionScheme newReactionScheme = setScheme(reaction, reactionSet);
            if (newReactionScheme.getReactionCount() != 0 || newReactionScheme.getReactionSchemeCount() != 0)
                reactionScheme.add(newReactionScheme);
        }
        return reactionScheme;
    }
1043537
@Override
    public void addAtom(IPDBAtom oAtom, IMonomer oMonomer, IStrand oStrand) {
        super.addAtom(oAtom, oMonomer, oStrand);
        if (!sequentialListOfMonomers.contains(oMonomer.getMonomerName()))
            sequentialListOfMonomers.add(oMonomer.getMonomerName());
    }
1004714
@Override
    public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
        if (atomContainerCount + 1 >= atomContainers.length) {
            growAtomContainerArray();
        }
        atomContainer.addListener(this);
        atomContainers[atomContainerCount] = atomContainer;
        multipliers[atomContainerCount] = multiplier;
        atomContainerCount++;
        notifyChanged();
    }
957029
private void addClause(final Formula formula, int weight) {
    this.result = UNDEF;
    final LNGIntVector clauseVec = new LNGIntVector((int) formula.numberOfAtoms());
    for (Literal lit : formula.literals()) {
      Integer index = this.var2index.get(lit.variable());
      if (index == null) {
        index = this.solver.newLiteral(false) >> 1;
        this.var2index.put(lit.variable(), index);
        this.index2var.put(index, lit.variable());
      }
      int litNum = lit.phase() ? index * 2 : (index * 2) ^ 1;
      clauseVec.push(litNum);
    }
    if (weight == -1) {
      this.solver.addHardClause(clauseVec);
    } else {
      this.solver.setCurrentWeight(weight);
      this.solver.updateSumWeights(weight);
      this.solver.addSoftClause(weight, clauseVec);
    }
  }
387480
@Override
    public void addProduct(IAtomContainer product, Double coefficient) {
        products.addAtomContainer(product, coefficient);
        /*
         * notifyChanged() is called by addReactant(Molecule reactant, double
         * coefficient)
         */
    }
458484
private void writeMoleculeSet(IAtomContainerSet som) throws Exception {
        for (IAtomContainer mol : som.atomContainers()) {
            writeMolecule(mol);
        }
    }
1222814
public void addExpression() {
        SWRL expression = getOWLModel().createSWRLExpression(null);
        if (getOWLValueObject().owlValue().isIndividual()) {
            SWRLIndividual swrlIndividual = swrl().wrapIndividual(getOWLValueObject().owlValue().castTo(OWLIndividual.class));
            Atom atom = swrl().createSameIndividualAtom(swrlIndividual, swrlIndividual);
            expression.setBody(swrl().createList(atom));
            asOWLSResult().addEffect(expression);
        }       
    }
90376
public void add(Object dependency, ValueSet valueSet) {
		if (dependency == null) {
			throw new IllegalArgumentException("dependency cannot be null");
		}
		if (valueSet != null) {
			dependencyToEntryTable.put(dependency, valueSet);
		}
	}
712057
@Override
    public double validate(IMolecularFormula formula) throws CDKException {
        logger.info("Start validation of ", formula);
        ensureDefaultOccurElements(formula.getBuilder());

        double isValid = 1.0;
        Iterator<IElement> itElem = MolecularFormulaManipulator.elements(formula).iterator();
        while (itElem.hasNext()) {
            IElement element = itElem.next();
            int occur = MolecularFormulaManipulator.getElementCount(formula, element);
            IIsotope elemIsotope = formula.getBuilder().newInstance(IIsotope.class, element.getSymbol());
            if ((occur < mfRange.getIsotopeCountMin(elemIsotope)) || (occur > mfRange.getIsotopeCountMax(elemIsotope))) {
                isValid = 0.0;
                break;
            }
        }

        return isValid;
    }
557861
protected void updateFormulas() {
        CTCalcChain calculationChain = getCalculationChain();
        int formulaCount = processInnerFormulas(calculationChain);
        processOuterFormulas(formulaCount, calculationChain);
    }
439271
private void makeCompounds(List<String> compoundList,
			List<String> sourceList) {
		//		System.out.println("[makeCompounds] making compounds from compoundLines");

		for (String line : compoundList) {
			if (compoundList.indexOf(line) + 1 == compoundList.size()) {
				//				System.out.println("[makeCompounds] Final line in compoundLines.");
				isLastCompndLine = true;
			}
			pdb_COMPND_Handler(line);

		}
		//		System.out.println("[makeCompounds] adding sources to compounds from sourceLines");
		// since we're starting again from the first compound, reset it here
		if ( entities.size() == 0){
			current_compound = new EntityInfo();
		} else {
			current_compound = entities.get(0);
		}
		for (String line : sourceList) {
			if (sourceList.indexOf(line) + 1 == sourceList.size()) {
				//				System.out.println("[makeCompounds] Final line in sourceLines.");
				isLastSourceLine = true;
			}
			pdb_SOURCE_Handler(line);
		}

	}
537185
@Override
    public void setup(IReactionSet reactionSet, Rectangle screen) {
        this.setScale(reactionSet);
        Rectangle2D bounds = BoundsCalculator.calculateBounds(reactionSet);
        this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
        this.drawCenter = new Point2d(screen.getCenterX(), screen.getCenterY());
        this.setup();
    }
57216
static void populateCellValue(final Cell cell, final ICellValue value) {
        if (cell == null) { return; }
        
        int cellType = resolveCellType(value);
        cell.setCellType(cellType);
        switch (cellType) {
            case CELL_TYPE_BLANK: { break; }
            case CELL_TYPE_BOOLEAN: { cell.setCellValue((Boolean) value.get()); break; }
            case CELL_TYPE_NUMERIC: { cell.setCellValue((Double) value.get()); break; }
            case CELL_TYPE_FORMULA: {
                try {
                    cell.setCellFormula(((String) value.get()).substring(1));
                    break;
                } catch (FormulaParseNameException e) {
                    log.error("Formula parsing error while trying to set formula field in cell " + e.getMessage());
                    cell.setCellFormula(ErrorEval.NAME_INVALID.getErrorString());
                    break;
                } catch (FormulaParseNAException e) {
                    log.error("Formula parsing error while trying to set formula field in cell " + e.getMessage());
                    cell.setCellFormula(ErrorEval.NA.getErrorString());
                    break;
                }
            }
            case CELL_TYPE_ERROR: { cell.setCellErrorValue(FormulaError.forString((String) value.get()).getCode()); break; }
            case CELL_TYPE_STRING: { cell.setCellValue((String) value.get()); break; }
            
            default: { throw new CalculationEngineException(String.format("Type of value %s is not supported: %s", value, value.getClass().getSimpleName())); }
        }
    }
37411
public static Rectangle2D calculateBounds(IChemModel chemModel) {
        IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
        IReactionSet reactionSet = chemModel.getReactionSet();
        Rectangle2D totalBounds = new Rectangle2D.Double();
        if (moleculeSet != null) {
            totalBounds = totalBounds.createUnion(calculateBounds(moleculeSet));
        }
        if (reactionSet != null) {
            totalBounds = totalBounds.createUnion(calculateBounds(reactionSet));
        }
        return totalBounds;
    }
892508
private Formula constructOr(final LinkedHashSet<? extends Formula> operands) {
    Or tempOr = null;
    Map<LinkedHashSet<? extends Formula>, Or> opOrMap = this.orsN;
    if (operands.size() > 1) {
      switch (operands.size()) {
        case 2:
          opOrMap = this.ors2;
          break;
        case 3:
          opOrMap = this.ors3;
          break;
        case 4:
          opOrMap = this.ors4;
          break;
        default:
          break;
      }
      tempOr = opOrMap.get(operands);
    }
    if (tempOr != null)
      return tempOr;
    final LinkedHashSet<? extends Formula> condensedOperands = operands.size() < 2
            ? operands
            : this.condenseOperandsOr(operands);
    if (condensedOperands == null)
      return this.verum();
    if (condensedOperands.isEmpty())
      return this.falsum();
    if (condensedOperands.size() == 1)
      return condensedOperands.iterator().next();
    final Or or;
    Map<LinkedHashSet<? extends Formula>, Or> condOrMap = this.orsN;
    switch (condensedOperands.size()) {
      case 2:
        condOrMap = this.ors2;
        break;
      case 3:
        condOrMap = this.ors3;
        break;
      case 4:
        condOrMap = this.ors4;
        break;
      default:
        break;
    }
    or = condOrMap.get(condensedOperands);
    if (or == null) {
      tempOr = new Or(condensedOperands, this, this.cnfCheck);
      opOrMap.put(operands, tempOr);
      condOrMap.put(condensedOperands, tempOr);
      return tempOr;
    }
    opOrMap.put(operands, or);
    return or;
  }