java - Do for loop in two parts -
how write in 1 loop
for (file file:files) { if (file.getname().endswith(".dat")) { species x = reader.readspecies(file); allspecies.add(x); allgenes.addall(x.getgenome()); } } (file file:files){ if (file.getname().endswith(".dat")) { species x = reader.readspecies(file); x.setindices(allgenes); } }
i want run through loop 1 segment next using 1 loop. possible? if not, code writing in violation of dry?
okay, no 1 answered far has understood question @ all. want code go through entire first loop. , entire second loop. set indices method not work until allgenes.addall has been completed ever file in loop.
it should
for (file file:files){ if (file.getname().endswith(".dat")){ species x = reader.readspecies(file); allspecies.add(x); allgenes.addall(x.getgenome()); x.setindices(allgenes); } }
Comments
Post a Comment