public class Facture {
private Client client = new Client();;
private float Paiement;
private float soustotal;
private float tps;
private float tvq;
private float ttc;
private List<LigneFacture> lignesFac = new ArrayList<LigneFacture>();
public Facture(){
this.Paiement=0;
this.soustotal=0;
this.tps=0;
this.tvq=0;
this.ttc=0;
}
public Client getClient() {
return client;
}
public void setClient(Client client) {
this.client = client;
}
public float getPaiement() {
return Paiement;
}
public void setPaiement(float Paiement) {
this.Paiement = Paiement;
}
public float getSoustotal() {
return soustotal;
}
public void setSoustotal(float soustotal) {
this.soustotal = soustotal;
}
public float getTps() {
return tps;
}
public void setTps(float tps) {
this.tps = tps;
}
public float getTvq() {
return tvq;
}
public void setTvq(float tvq) {
this.tvq = tvq;
}
public float getTtc() {
return ttc;
}
public void setTtc(float ttc) {
this.ttc = ttc;
}
public List<LigneFacture> getLignesFac() {
return lignesFac;
}
public void addLignesFacture(LigneFacture ligneFac){
this.lignesFac.add(ligneFac);
Iterator iter_lignesFact = lignesFac.iterator();
while(iter_lignesFact.hasNext()){
LigneFacture lignefac_cur = iter_lignesFact.next();
}
}
嗨,我有這個類,問題是在最後一個方法,Java的告訴我,iter_lignesFact返回一個對象值,而不是LigneFacture價值,因此他要我把它投到LigneFacture,爲什麼呢?我在LigneFacture的列表中定義了我的迭代器。