public IIsotope getIsotope ( String symbol , double exactMass , double tolerance ) { IIsotope ret = null ; double minDiff = Double . MAX_VALUE ; int elem = Elements . ofString ( symbol ) . number ( ) ; List < IIsotope > isotopes = this . isotopes [ elem ] ; if ( isotopes == null ) return null ; for ( IIsotope isotope : isotopes ) { double diff = Math . abs ( isotope . getExactMass ( ) - exactMass ) ; if ( isotope . getSymbol ( ) . equals ( symbol ) && diff <= tolerance && diff < minDiff ) { ret = clone ( isotope ) ; minDiff = diff ; } } return ret ; }
Get an isotope based on the element symbol and exact mass .