@Test public void testLabelCarbonicDihydrazide() throws StructureBuildingException { frag = fm.buildSMILES("C(=O)(NN)NN", NONCARBOXYLICACID_TYPE_VAL, NONE_LABELS_VAL); FragmentTools.assignElementLocants(frag, new ArrayList<Fragment>()); int idN = frag.getIDFromLocant("N"); int idNprime = frag.getIDFromLocant("N'"); int idNprime2 = frag.getIDFromLocant("N''"); int idNprime3 = frag.getIDFromLocant("N'''"); if ((idN==3 && idNprime==4 && idNprime2==5 && idNprime3==6) || (idN==5 && idNprime==6 && idNprime2==3 && idNprime3==4)){ } else{ fail("Locants misassigned"); } assertEquals("Can't find locant C in frag", 0, frag.getIDFromLocant("C")); }
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();  }