public static int countExplicitHydrogens ( IAtomContainer atomContainer , IAtom atom ) { if ( atomContainer == null || atom == null ) throw new IllegalArgumentException ( "null container or atom provided" ) ; int hCount = 0 ; for ( IAtom connected : atomContainer . getConnectedAtomsList ( atom ) ) { if ( Elements . HYDROGEN . getSymbol ( ) . equals ( connected . getSymbol ( ) ) ) { hCount ++ ; } } return hCount ; }
Count explicit hydrogens .