tp2correction
This commit is contained in:
31
GestionTravaux.java
Normal file
31
GestionTravaux.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package lepack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GestionTravaux {
|
||||
|
||||
private ArrayList<Batiment> listeBatiments;
|
||||
private ArrayList<Ouverture> listeOuvertures;
|
||||
private ArrayList<Technicien> listeTechniciens;
|
||||
|
||||
|
||||
public GestionTravaux() {
|
||||
this.listeBatiments = new ArrayList<>();
|
||||
this.listeOuvertures = new ArrayList<>();
|
||||
this.listeTechniciens = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ArrayList<Ouverture> getOuverturesNecessitantPlusDeKTechniciens(int k) {
|
||||
|
||||
ArrayList<Ouverture> resultat = new ArrayList<>();
|
||||
for (Ouverture o : this.listeOuvertures) {
|
||||
if (o.getNombreInstallateurs() > k) {
|
||||
resultat.add(o);
|
||||
}
|
||||
}
|
||||
return resultat;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user