tp2correction
This commit is contained in:
37
Technicien.java
Normal file
37
Technicien.java
Normal file
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user