@Test public void testAddAtom() { assertEquals("Has no atoms", 0, frag.getAtomCount()); frag.addAtom(new Atom(1, ChemEl.C, frag)); assertEquals("Now has one atom", 1, frag.getAtomCount()); }
void addAtom(Atom atom) { List<String> locants =atom.getLocants(); for (String locant: locants) { atomMapFromLocant.put(locant, atom); } atomMapFromId.put(atom.getID(), atom); atom.setFrag(this); }
Fragment implements Iterable<Atom> { void addAtom(Atom atom) { List<String> locants =atom.getLocants(); for (String locant: locants) { atomMapFromLocant.put(locant, atom); } atomMapFromId.put(atom.getID(), atom); atom.setFrag(this); } }
Fragment implements Iterable<Atom> { void addAtom(Atom atom) { List<String> locants =atom.getLocants(); for (String locant: locants) { atomMapFromLocant.put(locant, atom); } atomMapFromId.put(atom.getID(), atom); atom.setFrag(this); } Fragment(Element tokenEl);   Fragment(String type); }
Fragment implements Iterable<Atom> { void addAtom(Atom atom) { List<String> locants =atom.getLocants(); for (String locant: locants) { atomMapFromLocant.put(locant, atom); } atomMapFromId.put(atom.getID(), atom); atom.setFrag(this); } Fragment(Element tokenEl);   Fragment(String type); @Override Iterator<Atom> iterator(); }
Fragment implements Iterable<Atom> { void addAtom(Atom atom) { List<String> locants =atom.getLocants(); for (String locant: locants) { atomMapFromLocant.put(locant, atom); } atomMapFromId.put(atom.getID(), atom); atom.setFrag(this); } Fragment(Element tokenEl);   Fragment(String type); @Override Iterator<Atom> iterator();  }