@Test public void testLabelDiimidooxalicDiamide() throws StructureBuildingException { frag = fm.buildSMILES("CC", ACIDSTEM_TYPE_VAL, "1/2"); Fragment suffixfrag1 = fm.buildSMILES("[R](N)=N", SUFFIX_TYPE_VAL, NONE_LABELS_VAL); Fragment suffixfrag2 = fm.buildSMILES("[R](N)=N", SUFFIX_TYPE_VAL, NONE_LABELS_VAL); List<Fragment> suffixes = new ArrayList<Fragment>(); suffixes.add(suffixfrag1); suffixes.add(suffixfrag2); FragmentTools.assignElementLocants(frag, suffixes); fm.incorporateFragment(suffixfrag1, frag); fm.incorporateFragment(suffixfrag2, frag); assertEquals("Can find locant N in frag: ID = 4", 4, frag.getIDFromLocant("N")); assertEquals("Can find locant N' in frag: ID = 7", 7, frag.getIDFromLocant("N'")); assertEquals("Can find locant N'' in frag: ID = 5", 5, frag.getIDFromLocant("N''")); assertEquals("Can find locant N''' in frag: ID = 8", 8, 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();  }