@Test public void testAtom() { Atom atom = new Atom(10, ChemEl.C, frag); assertNotNull("Got atom", atom); assertEquals("Id = 10", 10, atom.getID()); assertEquals("Element = C", ChemEl.C, atom.getElement()); }
Atom(int id, ChemEl chemlEl, Fragment frag) { if (frag == null){ throw new IllegalArgumentException("Atom is not in a fragment!"); } if (chemlEl == null){ throw new IllegalArgumentException("Atom does not have an element!"); } this.frag = frag; this.id = id; this.chemEl = chemlEl; this.type =frag.getType(); }
Atom { Atom(int id, ChemEl chemlEl, Fragment frag) { if (frag == null){ throw new IllegalArgumentException("Atom is not in a fragment!"); } if (chemlEl == null){ throw new IllegalArgumentException("Atom does not have an element!"); } this.frag = frag; this.id = id; this.chemEl = chemlEl; this.type =frag.getType(); } }
Atom { Atom(int id, ChemEl chemlEl, Fragment frag) { if (frag == null){ throw new IllegalArgumentException("Atom is not in a fragment!"); } if (chemlEl == null){ throw new IllegalArgumentException("Atom does not have an element!"); } this.frag = frag; this.id = id; this.chemEl = chemlEl; this.type =frag.getType(); } Atom(int id, ChemEl chemlEl, Fragment frag);   Atom(ChemEl chemlEl); }
Atom { Atom(int id, ChemEl chemlEl, Fragment frag) { if (frag == null){ throw new IllegalArgumentException("Atom is not in a fragment!"); } if (chemlEl == null){ throw new IllegalArgumentException("Atom does not have an element!"); } this.frag = frag; this.id = id; this.chemEl = chemlEl; this.type =frag.getType(); } Atom(int id, ChemEl chemlEl, Fragment frag);   Atom(ChemEl chemlEl);  }
Atom { Atom(int id, ChemEl chemlEl, Fragment frag) { if (frag == null){ throw new IllegalArgumentException("Atom is not in a fragment!"); } if (chemlEl == null){ throw new IllegalArgumentException("Atom does not have an element!"); } this.frag = frag; this.id = id; this.chemEl = chemlEl; this.type =frag.getType(); } Atom(int id, ChemEl chemlEl, Fragment frag);   Atom(ChemEl chemlEl);   }