@Test public void testLabelHydrazonoHydrazide() throws StructureBuildingException { frag = fm.buildSMILES("C(=NN)NN" , NONCARBOXYLICACID_TYPE_VAL, NONE_LABELS_VAL); FragmentTools.assignElementLocants(frag, new ArrayList<Fragment>()); assertEquals("Can find locant N in frag: ID = 4", 4, frag.getIDFromLocant("N")); assertEquals("Can find locant N' in frag: ID = 5", 5, frag.getIDFromLocant("N'")); assertEquals("Can find locant N'' in frag: ID = 2", 2, frag.getIDFromLocant("N''")); assertEquals("Can find locant N''' in frag: ID = 3", 3, 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();  }