public static double getTotalCharge ( IAtomContainer atomContainer ) { double charge = 0.0 ; for ( IAtom atom : atomContainer . atoms ( ) ) { // we assume CDKConstant.UNSET is equal to 0 Double thisCharge = atom . getCharge ( ) ; if ( thisCharge != CDKConstants . UNSET ) charge += thisCharge ; } return charge ; }
Get the summed charge of all atoms in an AtomContainer