get membre d'un groupe donné

This commit is contained in:
brinet
2022-12-02 12:27:43 +01:00
parent 305927ef1c
commit 3f25c14e3d
25 changed files with 21 additions and 15 deletions

View File

@@ -36,13 +36,32 @@ public class Controller implements ActionListener, ListSelectionListener {
this.db = db;
this.e = this.db.getEtuList();
this.g = this.db.getGroupeList();
System.out.println(this.getMemberCount(-1) + " ");
this.sv = new StudentView(this.e, this.g, this);
this.pv = new ProfView(this.e, this.g, this);
this.av = new AdminView(this.e, this.g, this);
this.parent = new MainMenu(this);
}
/**
*
* Recuperer le nombre de membre d'un groupe
*
* @param groupe_id le groupes
* @return le nombre de membre
* */
public int getMemberCount(int id) {
int j = 0;
for(int i = 0; i <= this.e.size()-1; i++) {
if(this.e.get(i).getGroupe() == id) {
j++;
}
}
return j;
}
/**
* Pour creer une JTable
* @param data Les donnees