public void addCota(Cota cota) { int pos = 0; foreach (Cota aux : cotas) { if(aux.getDataVencimento().after(cota.getDataVencimento())) break; pos++; } cotas.add(pos,cota); }
public void addCota(Cota cota) { int pos = 0; foreach (Cota aux : cotas) { if (aux.getDataVencimento().after(cota.getDataVencimento())) { break; } pos++; } cotas.add(pos, cota); }