@Test public void notPhosphoSubstitution() throws StructureBuildingException { BuildState state = new BuildState(mock(NameToStructureConfig.class)); Element word = new GroupingEl(WORD_EL); Element amino = new TokenEl(GROUP_EL); Fragment aminoFrag = state.fragManager.buildSMILES("-N"); amino.setFrag(aminoFrag); Element substituent = new GroupingEl(SUBSTITUENT_EL); substituent.addChild(amino); Element methanol = new TokenEl(GROUP_EL); methanol.setFrag(state.fragManager.buildSMILES("CO")); Element root = new GroupingEl(ROOT_EL); root.addChild(methanol); word.addChild(substituent); word.addChild(root); StructureBuildingMethods.resolveRootOrSubstituentUnLocanted(state, substituent); Set<Bond> interFragmentBonds = state.fragManager.getInterFragmentBonds(aminoFrag); assertEquals(1, interFragmentBonds.size()); assertEquals(ChemEl.C, interFragmentBonds.iterator().next().getOtherAtom(aminoFrag.getFirstAtom()).getElement()); }
static void resolveRootOrSubstituentUnLocanted(BuildState state, Element subOrRoot) throws StructureBuildingException { boolean foundSomethingToSubstitute = potentiallyCanSubstitute(subOrRoot); resolveUnLocantedFeatures(state, subOrRoot); if (foundSomethingToSubstitute){ performUnLocantedSubstitutiveOperations(state, subOrRoot); } }
StructureBuildingMethods { static void resolveRootOrSubstituentUnLocanted(BuildState state, Element subOrRoot) throws StructureBuildingException { boolean foundSomethingToSubstitute = potentiallyCanSubstitute(subOrRoot); resolveUnLocantedFeatures(state, subOrRoot); if (foundSomethingToSubstitute){ performUnLocantedSubstitutiveOperations(state, subOrRoot); } } }
StructureBuildingMethods { static void resolveRootOrSubstituentUnLocanted(BuildState state, Element subOrRoot) throws StructureBuildingException { boolean foundSomethingToSubstitute = potentiallyCanSubstitute(subOrRoot); resolveUnLocantedFeatures(state, subOrRoot); if (foundSomethingToSubstitute){ performUnLocantedSubstitutiveOperations(state, subOrRoot); } } private  StructureBuildingMethods(); }
StructureBuildingMethods { static void resolveRootOrSubstituentUnLocanted(BuildState state, Element subOrRoot) throws StructureBuildingException { boolean foundSomethingToSubstitute = potentiallyCanSubstitute(subOrRoot); resolveUnLocantedFeatures(state, subOrRoot); if (foundSomethingToSubstitute){ performUnLocantedSubstitutiveOperations(state, subOrRoot); } } private  StructureBuildingMethods();  }
StructureBuildingMethods { static void resolveRootOrSubstituentUnLocanted(BuildState state, Element subOrRoot) throws StructureBuildingException { boolean foundSomethingToSubstitute = potentiallyCanSubstitute(subOrRoot); resolveUnLocantedFeatures(state, subOrRoot); if (foundSomethingToSubstitute){ performUnLocantedSubstitutiveOperations(state, subOrRoot); } } private  StructureBuildingMethods();   }