Permalink
Browse files

Including JavaDoc for new methods. Would also be better to use Elemen…

…ts from a symbol, currently the method is case sensitive.
  • Loading branch information...
1 parent ee7907e commit 2fe701a688a5a829e0fdf4e3d4a864b66a8fd118 @johnmay johnmay committed Feb 23, 2014
@@ -95,12 +95,28 @@ public static int getElementCount(IMolecularFormula formula, IElement element) {
return count;
}
- public static int getElementCount(IMolecularFormula formula, IIsotope isotope) {
- return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, isotope));
+ /**
+ * Occurrences of a given element from an isotope in a molecular formula.
+ *
+ * @param formula the formula
+ * @param isotope isotope of an element
+ * @return number of the times the element occurs
+ * @see #getElementCount(IMolecularFormula, IElement)
+ */
+ public static int getElementCount(IMolecularFormula formula, IIsotope isotope) {
+ return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, isotope));
}
- public static int getElementCount(IMolecularFormula formula, String symbol) {
- return getElementCount(formula, formula.getBuilder().newInstance(IIsotope.class, symbol));
+ /**
+ * Occurrences of a given element in a molecular formula.
+ *
+ * @param formula the formula
+ * @param symbol element symbol (e.g. C for carbon)
+ * @return number of the times the element occurs
+ * @see #getElementCount(IMolecularFormula, IElement)
+ */
+ public static int getElementCount(IMolecularFormula formula, String symbol) {
+ return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, symbol));
}
/**

0 comments on commit 2fe701a

Please sign in to comment.