37 lines
912 B
Java
37 lines
912 B
Java
package lepack;
|
|
import java.util.*;
|
|
|
|
public class Technicien {
|
|
|
|
private ArrayList<Ouverture> listeOuvertures;
|
|
private String nom;
|
|
private int anneesExperience;
|
|
|
|
public Technicien(String nom, int anneesExperience) {
|
|
this.nom = nom;
|
|
this.anneesExperience = anneesExperience;
|
|
this.listeOuvertures = new ArrayList<>();
|
|
}
|
|
|
|
public void getFicheInfo() {
|
|
System.out.println("Technicien : " + this.nom + " (" + this.anneesExperience + " ans d'exp.)");
|
|
}
|
|
|
|
public void ajouterIntervention(Ouverture o) {
|
|
if (o != null) {
|
|
this.listeOuvertures.add(o);
|
|
}
|
|
}
|
|
|
|
public int getSommeLargeurInterventions() {
|
|
int somme = 0;
|
|
for (Ouverture o : this.listeOuvertures) {
|
|
somme += o.getLargeur();
|
|
}
|
|
return somme;
|
|
}
|
|
|
|
public String getNom() {
|
|
return this.nom;
|
|
}
|
|
} |