public boolean couldMatchAtomType ( IAtom atom , double bondOrderSum , IBond . Order maxBondOrder , IAtomType type ) { logger . debug ( "couldMatchAtomType: ... matching atom " , atom , " vs " , type ) ; int hcount = atom . getImplicitHydrogenCount ( ) ; int charge = atom . getFormalCharge ( ) ; if ( charge == type . getFormalCharge ( ) ) { logger . debug ( "couldMatchAtomType: formal charge matches..." ) ; // if (atom.getHybridization() == type.getHybridization()) { // logger.debug("couldMatchAtomType: hybridization is OK..."); if ( bondOrderSum + hcount <= type . getBondOrderSum ( ) ) { logger . debug ( "couldMatchAtomType: bond order sum is OK..." ) ; if ( ! BondManipulator . isHigherOrder ( maxBondOrder , type . getMaxBondOrder ( ) ) ) { logger . debug ( "couldMatchAtomType: max bond order is OK... We have a match!" ) ; return true ; } } else { logger . debug ( "couldMatchAtomType: no match" , "" + ( bondOrderSum + hcount ) , " > " , "" + type . getBondOrderSum ( ) ) ; } // } } else { logger . debug ( "couldMatchAtomType: formal charge does NOT match..." ) ; } logger . debug ( "couldMatchAtomType: No Match" ) ; return false ; }
Determines if the atom can be of type AtomType . That is it sees if this AtomType only differs in bond orders or implicit hydrogen count .