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