ajout fonction API

This commit is contained in:
2022-11-12 23:27:30 +01:00
parent 08f2675993
commit 191635b8f7
2 changed files with 44 additions and 5 deletions

View File

@@ -224,7 +224,17 @@ public class AbstractGroupeFactoryNP implements AbstractGroupeFactory {
* @throws java.lang.NullPointerException si le String est null.
*/
public Set<Groupe> getGroupesOfEtudiant(Etudiant etu){
throw new UnsupportedOperationException("pas encore implanté");
Collection<Groupe> s= this.brain.values();
Set<Groupe> ret=new LinkedHashSet<Groupe>();
for(Groupe g: s){
for(Etudiant e: g.getEtudiants()){
if(e==etu){
ret.add(g);
break;
}
}
}
return ret;
}
/**