@Test public void testGetIDFromLocant() { Atom atom = new Atom(10, ChemEl.C, frag); atom.addLocant("a"); frag.addAtom(atom); atom = new Atom(20, ChemEl.C, frag); atom.addLocant("silly"); frag.addAtom(atom); assertEquals("Locant a has ID 10", 10, frag.getIDFromLocant("a")); assertEquals("Locant silly has ID 20", 20, frag.getIDFromLocant("silly")); assertEquals("Locant 42 is not present", 0, frag.getIDFromLocant("42")); }
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();  }