if(verbose) System.out.println("One bond?");
if(l.size() != 1) continue;
Bond b = (Bond)l.get(0);
if(verbose) System.out.println("Not a stereo bond?");
if(b.getStereo() != CDKConstants.STEREO_BOND_NONE) continue;
IAtom otherAtom = b.getConnectedAtom(mol.getAtom(i));
// Special cases
/*if(getInstance().valencies.containsKey(otherAtom.getAtomicNumber())) {
int valency = getInstance().valencies.get(otherAtom.getAtomicNumber());
if(valency == 1) {
if(otherAtom.getFormalCharge() != 0) valency = 0;
}
System.out.println(valency);
if(valency < mol.getConnectedAtomsCount(otherAtom)) {
System.out.println("removing");
System.out.println(mol.getAtomCount());
mol.removeAtomAndConnectedElectronContainers(mol.getAtom(i));
System.out.println(mol.getAtomCount());
i--;
continue;
}
}*/
if(verbose) System.out.println("Connect to carbon?");
if(verbose) System.out.println(otherAtom.getAtomicNumber());
if(otherAtom.getAtomicNumber() != 6) continue;
if(verbose) System.out.println("Bridgehead?");
if(!removeBridgeHeads && mol.getConnectedAtomsCount(otherAtom) == 4) {
List ll = mol.getConnectedAtomsList(otherAtom);
boolean isBridgehead = true;
for(Object o : ll) {
IAtom aa = (IAtom)o;
if(aa == mol.getAtom(i)) continue;
// Detect cyclicity
if(!isRingBond(mol, aa, otherAtom)) {
// ie if it isn't cyclic
isBridgehead = false;