@PublicAPI public class MolecularFormulas extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ElementalAnalysis |
createAnalysis(java.lang.String formula)
Constructs an elemental analysis from molecular formula.
|
static com.chemaxon.calculations.elemanal.formula.MolecularFormula |
fromFormula(java.lang.String formula) |
static com.chemaxon.calculations.elemanal.formula.MolecularFormula |
fromMolecule(Molecule molecule) |
static com.chemaxon.calculations.elemanal.formula.MolecularFormula |
fromMolecule(Molecule molecule,
boolean ignorePseudoLabels) |
public static com.chemaxon.calculations.elemanal.formula.MolecularFormula fromFormula(java.lang.String formula)
public static com.chemaxon.calculations.elemanal.formula.MolecularFormula fromMolecule(Molecule molecule, boolean ignorePseudoLabels)
public static com.chemaxon.calculations.elemanal.formula.MolecularFormula fromMolecule(Molecule molecule)
public static ElementalAnalysis createAnalysis(java.lang.String formula)
Multiple fragments with fractional stoichiometric coefficients are supported:
CH3O.0.5Na.1.5H2O, NaCl.1.5H2O, AlCl3.1.5H2O
If the molecular formula contains any unspecified symbol (e.g. R, Pol) the analysis do not take into
consideration these symbols. The analysis returns the same result for formulas either with or without these
symbols.
formula
- molecular formula, e.g. C3H8NO2, Al2(CO3)3.2H2OElementalAnalysis
instancecom.chemaxon.calculations.elemanal.formula.tree.InvalidFormulaException
- if the parser cannot parse the formula string