@Test public void testLabelSulfonoThioate() throws StructureBuildingException { frag = fm.buildSMILES("C"); Fragment suffix = fm.buildSMILES("[R]S(=O)(=O)S", 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 S in frag: ID = 6", 6, frag.getIDFromLocant("S")); assertEquals("Can't find locant S' in frag", 0, frag.getIDFromLocant("S'")); int idO = frag.getIDFromLocant("O"); int idOprime = frag.getIDFromLocant("O'"); if ((idO==4 && idOprime==5)|| (idO==5 && idOprime==4)){ } 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();  }