public final class Molecule extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
MOLECULAR_FORMULA_PATTERN
A pattern to match molecular formulas.
|
Modifier and Type | Method and Description |
---|---|
static double |
computeMolecularWeight(String molecularFormula)
Computes the molecular weight for the supplied molecularFormula.
|
static boolean |
isValidMolecularFormula(String molecularFormula)
Determines whether the supplied molecularFormula is valid.
|
public static final Pattern MOLECULAR_FORMULA_PATTERN
public static double computeMolecularWeight(String molecularFormula)
molecularFormula
- The molecular formula.IllegalArgumentException
- When the supplied molecularFormula is
empty or contains non existing elements or has not the proper structure.NullPointerException
- When the supplied molecularFormula is null.public static boolean isValidMolecularFormula(String molecularFormula)
molecularFormula
- The molecular formula to check.Copyright © 2008–2018. All rights reserved.