@Test public void testLabelCarboximidohydrazide() throws StructureBuildingException { frag = fm.buildSMILES("c1ccccc1"); Fragment suffix = fm.buildSMILES("[R]C(=N)NN", SUFFIX_TYPE_VAL, "/X List<Fragment> suffixes = new ArrayList<Fragment>(); suffixes.add(suffix); FragmentTools.assignElementLocants(frag, suffixes); fm.incorporateFragment(suffix, frag); assertEquals("Can find locant N in frag: ID = 10", 10, frag.getIDFromLocant("N")); assertEquals("Can find locant N' in frag: ID = 11", 11, frag.getIDFromLocant("N'")); assertEquals("Can find locant N'' in frag: ID = 9", 9, frag.getIDFromLocant("N''")); }
int getIDFromLocant(String locant) { Atom a = getAtomByLocant(locant); if (a != null){ return a.getID(); } return 0; }
Fragment implements Iterable<Atom> { int getIDFromLocant(String locant) { Atom a = getAtomByLocant(locant); if (a != null){ return a.getID(); } return 0; } }
Fragment implements Iterable<Atom> { int getIDFromLocant(String locant) { Atom a = getAtomByLocant(locant); if (a != null){ return a.getID(); } return 0; } Fragment(Element tokenEl);   Fragment(String type); }
Fragment implements Iterable<Atom> { int getIDFromLocant(String locant) { Atom a = getAtomByLocant(locant); if (a != null){ return a.getID(); } return 0; } Fragment(Element tokenEl);   Fragment(String type); @Override Iterator<Atom> iterator(); }
Fragment implements Iterable<Atom> { int getIDFromLocant(String locant) { Atom a = getAtomByLocant(locant); if (a != null){ return a.getID(); } return 0; } Fragment(Element tokenEl);   Fragment(String type); @Override Iterator<Atom> iterator();  }