public static int getElementCount ( IMolecularFormula formula , IElement element ) { int count = 0 ; for ( IIsotope isotope : formula . isotopes ( ) ) { if ( isotope . getSymbol ( ) . equals ( element . getSymbol ( ) ) ) count += formula . getIsotopeCount ( isotope ) ; } return count ; }
Checks a set of Nodes for the occurrence of the isotopes in the molecular formula from a particular IElement . It returns 0 if the element does not exist . The search is based only on the IElement .