Hello!
I'm manipulating ArrayList <monObjet>. I want to create an ArrayList "molecule" containing amino acids. Each amino acid is an ArrayList of atoms. My problem, c "is that when I do a display at the end of treatment, the ArrayList" molecule ", contains only copies of a AcideAmine the last set. I think my program is returning a incorrect arraylist
Here's the code:
Code:
while (Onln! = null) {
if (condition){
/ / New amino acid
AcideAmine cur = new AcideAmine(row.substring(17,20).toCharArray());
while (autreCondition){
/ / Creating an object Atom
atnm = ln.substring(13,16).toCharArray();
Atom atomTrouve = new Atom(atnm);
/ / Add the atom in the current AA
cur.addAtom(atomTrouve);
ln = br.readLine();
}
System.out.print("CurrentAA =");
cur.print();
arls.add(cur);
cur = null ; / / In case
}
}
}
Bookmarks