Skip to content

Commit 9fabdc5

Browse files
committed
♻ Refactorisation Planning getPlanningOf Professeurs
1 parent 4f0a944 commit 9fabdc5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main/java/fr/umontp/edt/Planning.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author emerick-biron
2323
* @author MathieuSoysal
24-
* @version 1.4.0
24+
* @version 1.4.2
2525
* @see Iterable
2626
* @see Planifiable
2727
* @see Cours
@@ -50,7 +50,7 @@ private Planning() {
5050
* @param dates dates pour lesquelles on veut obtenir le planning.
5151
* @return {@code Planning} correspondant
5252
* @see Planning
53-
* @since 1.3.1
53+
* @since 1.3.0
5454
*/
5555
@Override
5656
public Planning getPlanningOf(LocalDate... dates) {
@@ -88,7 +88,7 @@ public Planning getPlanningOf(LocalDate date, Groupe groupe) {
8888
* @return planning correspondant
8989
* @see Groupe
9090
* @see Planning
91-
* @since 1.3.1
91+
* @since 1.4.1
9292
*/
9393
@Override
9494
public Planning getPlanningOf(Groupe... groupes) {
@@ -106,17 +106,18 @@ public Planning getPlanningOf(Groupe... groupes) {
106106
*
107107
* @param professeurs professeurs dont on veut obtenir le planning
108108
* @return planning correspondant
109-
* @since 1.2
109+
* @since 1.4.2
110110
*
111111
* @see Professeur
112112
* @see Planning
113113
*/
114114
@Override
115115
public Planning getPlanningOf(Professeur... professeurs) {
116116
Planning result = new Planning();
117-
for (Professeur professeur : professeurs)
118-
result.cours
119-
.addAll(this.cours.stream().filter(c -> c.estEnseignePar(professeur)).collect(Collectors.toSet()));
117+
for (Cours c : cours)
118+
for (Professeur p : professeurs)
119+
if (c.estEnseignePar(p))
120+
result.cours.add(c);
120121
return result;
121122
}
122123

0 commit comments

Comments
 (0)