1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
List listCheque101 = new LinkedList();
List listCheque100 = new LinkedList();
....
public void matchCheque(){
Iterator it100=listCheque100.iterator();
Iterator it101=listCheque101.iterator();
while (it100.hasNext()){ // tant que j'ai un element non parcouru
Cheque o100 = (Cheque) it100.next();
while (it101.hasNext()){ // tant que j'ai un element non parcouru
Cheque o101 = (Cheque) it101.next();
//si les données sont identique, il y a addition des nombres de cheque
if(o100.getFederation().equals(o101.getFederation()) &&
o100.getCaisse().equals(o101.getCaisse()) &&
o100.getGuichet().equals(o101.getGuichet()) &&
o100.getDateCollecte().equals(o101.getDateCollecte()) &&
o100.getHeureCollecte().equals(o101.getHeureCollecte()) ){
o100.setNbCheque(o100.getNbCheque() + o101.getNbCheque());
//ne passe jamais ici
}
}
}
} |
Partager