From 6fd63a12263dcbcc5b17fe7ec6e313ce76c7ac25 Mon Sep 17 00:00:00 2001 From: Florent Madelaine Date: Wed, 26 Oct 2022 15:32:48 +0200 Subject: [PATCH] version beta --- Makefile | 104 ++++---- README.md | 8 +- .../API/AbstractChangementFactory.class | Bin 0 -> 656 bytes .../API/AbstractGroupeFactory.class | Bin 0 -> 1079 bytes .../projetIHM2022FI2/API/Changement.class | Bin 0 -> 1340 bytes .../projetIHM2022FI2/API/Etudiant.class | Bin 0 -> 985 bytes .../projetIHM2022FI2/API/Groupe.class | Bin 0 -> 2368 bytes .../projetIHM2022FI2/API/MonPrint.class | Bin 0 -> 173 bytes .../projetIHM2022FI2/API/TypeGroupe.class | Bin 0 -> 1224 bytes .../MNP/AbstractChangementFactoryNP.class | Bin 0 -> 3401 bytes .../MNP/AbstractGroupeFactoryNP.class | Bin 0 -> 6206 bytes .../projetIHM2022FI2/MNP/ChangementNP.class | Bin 0 -> 1397 bytes .../projetIHM2022FI2/MNP/EtudiantNP.class | Bin 0 -> 916 bytes .../projetIHM2022FI2/MNP/GroupeNP.class | Bin 0 -> 4009 bytes .../projetIHM2022FI2/Test/TestTexteMNP.class | Bin 0 -> 7819 bytes .../API/AbstractChangementFactory.java | 55 ++++ .../API/AbstractChangementFactory.java~ | 44 ++++ .../API/AbstractGroupeFactory.java | 115 +++++++++ .../API/AbstractGroupeFactory.java~ | 106 ++++++++ .../projetIHM2022FI2/API/Changement.java | 49 ++++ .../projetIHM2022FI2/API/Changement.java~ | 49 ++++ .../projetIHM2022FI2/API/Etudiant.java | 33 +++ .../projetIHM2022FI2/API/Etudiant.java~ | 33 +++ .../projetIHM2022FI2/API/Groupe.java | 121 +++++++++ .../projetIHM2022FI2/API/Groupe.java~ | 121 +++++++++ .../projetIHM2022FI2/API/MonPrint.java | 12 + .../projetIHM2022FI2/API/MonPrint.java~ | 7 + .../projetIHM2022FI2/API/TypeGroupe.java | 10 + .../projetIHM2022FI2/API/TypeGroupe.java~ | 10 + .../MNP/AbstractChangementFactoryNP.java | 104 ++++++++ .../MNP/AbstractChangementFactoryNP.java~ | 101 ++++++++ .../MNP/AbstractGroupFactoryNP.java~ | 106 ++++++++ .../MNP/AbstractGroupeFactoryNP.java | 225 +++++++++++++++++ .../MNP/AbstractGroupeFactoryNP.java~ | 222 ++++++++++++++++ .../projetIHM2022FI2/MNP/ChangementNP.java | 63 +++++ .../projetIHM2022FI2/MNP/ChangementNP.java~ | 60 +++++ .../projetIHM2022FI2/MNP/EtudiantNP.java | 51 ++++ .../projetIHM2022FI2/MNP/EtudiantNP.java~ | 51 ++++ .../projetIHM2022FI2/MNP/GroupeNP.java | 192 ++++++++++++++ .../projetIHM2022FI2/MNP/GroupeNP.java~ | 199 +++++++++++++++ .../MNP/ReservationFactoryNP.java~ | 164 ++++++++++++ .../projetIHM2022FI2/Test/TestTexteMNP.java | 236 ++++++++++++++++++ .../projetIHM2022FI2/Test/TestTexteMNP.java~ | 218 ++++++++++++++++ 43 files changed, 2816 insertions(+), 53 deletions(-) create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/Changement.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/Groupe.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.class create mode 100644 build/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.class create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupFactoryNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/MNP/ReservationFactoryNP.java~ create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java create mode 100644 src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java~ diff --git a/Makefile b/Makefile index d7320ea..30f58f2 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ JAR = jar EXEC_JAR = ${JAVA} -jar # CHEMINS RELATIFS -SRC = src/fr/iutfbleau/projetIHM2021FI2 -BUILD = build/fr/iutfbleau/projetIHM2021FI2 -DOC = doc/fr/iutfbleau/projetIHM2021FI2 +SRC = src/fr/iutfbleau/projetIHM2022FI2 +BUILD = build/fr/iutfbleau/projetIHM2022FI2 +DOC = doc/fr/iutfbleau/projetIHM2022FI2 # CHOIX NOMS JAR_MNP = test-mnp.jar @@ -23,7 +23,7 @@ run : ${JAR_MNP} # AUTRE BUTS doc : - javadoc -d doc src/fr/iutfbleau/projetIHM2021FI2/API/*.java src/fr/iutfbleau/projetIHM2021FI2/MNP/*.java + javadoc -d doc src/fr/iutfbleau/projetIHM2022FI2/API/*.java src/fr/iutfbleau/projetIHM2022FI2/MNP/*.java clean : rm -rf ${BUILD}/* *.jar @@ -35,75 +35,77 @@ clean : ${BUILD}/API/MonPrint.class : ${SRC}/API/MonPrint.java ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/MonPrint.java -${BUILD}/API/TypeChambre.class : ${SRC}/API/TypeChambre.java - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/TypeChambre.java +${BUILD}/API/TypeGroupe.class : ${SRC}/API/TypeGroupe.java + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/TypeGroupe.java -${BUILD}/API/Chambre.class : ${SRC}/API/Chambre.java \ - ${BUILD}/API/TypeChambre.class\ +${BUILD}/API/Groupe.class : ${SRC}/API/Groupe.java \ + ${BUILD}/API/TypeGroupe.class\ ${BUILD}/API/MonPrint.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Chambre.java + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Groupe.java -${BUILD}/API/Client.class : ${SRC}/API/Client.java \ +${BUILD}/API/Etudiant.class : ${SRC}/API/Etudiant.java \ ${BUILD}/API/MonPrint.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Client.java + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Etudiant.java -${BUILD}/API/Prereservation.class : ${SRC}/API/Prereservation.java \ - ${BUILD}/API/TypeChambre.class \ - ${BUILD}/API/Client.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Prereservation.java +${BUILD}/API/Changement.class : ${SRC}/API/Changement.java \ + ${BUILD}/API/Etudiant.class \ + ${BUILD}/API/Groupe.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Changement.java -${BUILD}/API/Reservation.class : ${SRC}/API/Reservation.java \ - ${BUILD}/API/Chambre.class \ - ${BUILD}/API/Prereservation.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Reservation.java +${BUILD}/API/AbstractGroupeFactory.class : ${SRC}/API/AbstractGroupeFactory.java \ + ${BUILD}/API/Groupe.class \ + ${BUILD}/API/Etudiant.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/AbstractGroupeFactory.java -${BUILD}/API/PrereservationFactory.class : ${SRC}/API/PrereservationFactory.java \ - ${BUILD}/API/Prereservation.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/PrereservationFactory.java - -${BUILD}/API/ReservationFactory.class : ${SRC}/API/ReservationFactory.java \ - ${BUILD}/API/Reservation.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/ReservationFactory.java +${BUILD}/API/AbstractChangementFactory.class : ${SRC}/API/AbstractChangementFactory.java \ + ${BUILD}/API/AbstractGroupeFactory.class \ + ${BUILD}/API/Changement.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/AbstractChangementFactory.java ## MNP ## -${BUILD}/MNP/ClientNP.class : ${SRC}/MNP/ClientNP.java \ - ${BUILD}/API/Client.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ClientNP.java +${BUILD}/MNP/EtudiantNP.class : ${SRC}/MNP/EtudiantNP.java \ + ${BUILD}/API/Etudiant.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/EtudiantNP.java -${BUILD}/MNP/ChambreNP.class : ${SRC}/MNP/ChambreNP.java \ - ${BUILD}/API/Chambre.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ChambreNP.java -${BUILD}/MNP/PrereservationNP.class : ${SRC}/MNP/PrereservationNP.java \ - ${BUILD}/MNP/ClientNP.class \ - ${BUILD}/API/Prereservation.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/PrereservationNP.java +${BUILD}/MNP/GroupeNP.class : ${SRC}/MNP/GroupeNP.java \ + ${BUILD}/API/Groupe.class \ + ${BUILD}/API/TypeGroupe.class \ + ${BUILD}/API/Etudiant.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/GroupeNP.java -${BUILD}/MNP/ReservationNP.class : ${SRC}/MNP/ReservationNP.java \ - ${BUILD}/API/Reservation.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ReservationNP.java -${BUILD}/MNP/PrereservationFactoryNP.class : ${SRC}/MNP/PrereservationFactoryNP.java \ - ${BUILD}/API/PrereservationFactory.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/PrereservationFactoryNP.java +${BUILD}/MNP/ChangementNP.class : ${BUILD}/API/Changement.class \ + ${SRC}/MNP/ChangementNP.java \ + ${BUILD}/API/Groupe.class \ + ${BUILD}/API/Etudiant.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ChangementNP.java -${BUILD}/MNP/ReservationFactoryNP.class : ${SRC}/MNP/ReservationFactoryNP.java \ - ${BUILD}/MNP/ChambreNP.class \ - ${BUILD}/MNP/ReservationNP.class \ - ${BUILD}/API/ReservationFactory.class - ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ReservationFactoryNP.java +${BUILD}/MNP/AbstractGroupeFactoryNP.class : ${SRC}/MNP/AbstractGroupeFactoryNP.java \ + ${BUILD}/API/AbstractGroupeFactory.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/AbstractGroupeFactoryNP.java + +${BUILD}/MNP/AbstractChangementFactoryNP.class : ${SRC}/MNP/AbstractChangementFactoryNP.java \ + ${BUILD}/API/AbstractChangementFactory.class \ + ${BUILD}/API/Changement.class + ${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/AbstractChangementFactoryNP.java + + +###... ## TEST ## ${BUILD}/Test/TestTexteMNP.class : ${SRC}/Test/TestTexteMNP.java \ - ${BUILD}/MNP/PrereservationNP.class \ - ${BUILD}/MNP/PrereservationFactoryNP.class \ - ${BUILD}/MNP/ReservationFactoryNP.class + ${BUILD}/MNP/EtudiantNP.class \ + ${BUILD}/MNP/GroupeNP.class \ + ${BUILD}/MNP/ChangementNP.class \ + ${BUILD}/MNP/AbstractGroupeFactoryNP.class \ + ${BUILD}/MNP/AbstractChangementFactoryNP.class ${JAVAC} -Xlint:deprecation ${JAVAC_OPTIONS} ${SRC}/Test/TestTexteMNP.java # ## JARS ## ${JAR_MNP} : ${BUILD}/Test/TestTexteMNP.class - ${JAR} cvfe ${JAR_MNP} fr.iutfbleau.projetIHM2021FI2.Test.TestTexteMNP -C build fr + ${JAR} cvfe ${JAR_MNP} fr.iutfbleau.projetIHM2022FI2.Test.TestTexteMNP -C build fr diff --git a/README.md b/README.md index b869ea5..ff9eb95 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# APIHotel +# APIGroupes -API pour le projet IHM 2021-2022. +Attention l'API n'est pas encore complètement testée. + +Je viens d'ajouter des éléments pour les changements (modèles NP, changements mineurs dans l'API et exemples dans le fichier de test). + +API pour le projet IHM 2022-2023. Vous avez un makefile qui permet de générer la javadoc en faisant. $ make doc diff --git a/build/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.class b/build/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.class new file mode 100644 index 0000000000000000000000000000000000000000..68bcaf2d89aa58c8a5904fb87d5b52b8a63a75ac GIT binary patch literal 656 zcmb7?O-{ow5QWF3KeYTbZOJg^;8)JXUf<0J;vru5Q;{AG;SV24Yx z(@YiAq_?IncO68fH3Ofe=^q69vWic0rt&V%F`=#i0WJPZ l0G+mgEocMq*?}(WJyu(=&G$YGR{BnT?!q3|1njRmhM$0O!MFeb literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.class b/build/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.class new file mode 100644 index 0000000000000000000000000000000000000000..634d5e0d507415b2f71d7a02a2e435d3a5eb2c64 GIT binary patch literal 1079 zcmbtT%T59@6um_r@(@t*g-bV(sAJf$7+;t;Itd2M7!#L;DU;$jC8eYB*If7kew6Vt z!-xqcKvk52%o!+r|(Qcxz4bC_yN@gfu#9)ZJ3wb_#z_f@asGU{ss zDf&#Aw|BLZTFo$PTBB`hH&XZmrV~g!d*W?K;G!}=tJ>_-SE{+xbF?cVu!@IDIh(mm zu~3=7(ISG6NbgEUC-lYw^gnhiCAsJ5rddVFLMYj$Qt@y&m&>V+M6=YkA4JsU(;|Yi zW4Tto&8esKQKh^s#lXO1qhh0^qZ=66L1nt}aWuZ-u4XZXv7{~TcvSh45xAetIGy7e zL>}~W)Gwi_(BQDui%tlf%`=$jx;|~2FT@tJ9IHPi-GgOjx$4wcy z67v0c^x_HBXGi!ioj`H&Wm=s+>#8IH0x|r`0O>e^6^H{MCLkGL3RVM5Lngp1KKlRw literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/API/Changement.class b/build/fr/iutfbleau/projetIHM2022FI2/API/Changement.class new file mode 100644 index 0000000000000000000000000000000000000000..bbd34c14ab05de51ffce781ab277d9940502cda4 GIT binary patch literal 1340 zcma)6ZBG+H5Pp`IUTsebh~O($1ubta78SIJLL*XBkOU$cKP|nb99(ZNcY7rK6Mu%E zFks>j@JAVEd)0z%fDfIWna=av%+AdI`hD^fz$}UeZYRKSCy6BPCNYeAT1zK!9}l$l zu%F@{>yV5VV+O_zOcVwqQz^bZZt zqQuHl?uQnhuS<6qLl05_owP{xlXj?n(w0#K z(_2Pzi1bhBLI<65KfpeJM@M;L{1}}K#~My*w^oUtRHLDuAPyYi%GSgY65r~4H%RuN lljJ1*IfWTy$+}5)2X0}3PW{@=;|*SscZBRX*`xG(^aoBpW^4ce literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.class b/build/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.class new file mode 100644 index 0000000000000000000000000000000000000000..a784b4475e6ab3515b48bca357dbe02c87f44aad GIT binary patch literal 985 zcma)5+iuf95IxgeoVqS8rKOZh8z6-wKwagfLJcsIz_PSF4 zgwNoSR)P=UqY&dbs6mN<2hYyT&dlyPd;H_)^>+YAI9!2&JF(e}&DI8IcMRM&@c<7E zJTkCL$n>Rlx`b4*EcSB9TX>8oynS<>5AA{MXai3z6tGVy_X69EbdQe|kv$I7fH57PR1PbZ zx>K>=HXZx-(f?I^G6iPh8J-iin2|i?6Wr_+-R>JI5w=HSC~L~^2>sF3=j?@=(S?N9 z#d-4PGtNSaXK*I8^Q-h!FcQr3qPd@D1}DT+7tA$KjCp)XDBSSq`WI>_r>~m;sf&(Q z!KHx%KDMFMFd7pq$MCsWXHnqdNM2|jn$c(O%*hg`J?gdax52= z{{!1}L``^J%hj@Kz$Wa^;ahY!!tUSevc$hk1}t;_Ytm_!K1_BfR_$bE;qngQ7OyOQ z_K%Qa57;YTfmmo)Sen=r;TmZm^$nS?$bOl$t+UN0<=l3gqa|$M1+OM&OL&Dcc5s*D K9LL-I-TMW1$_7XP literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/API/Groupe.class b/build/fr/iutfbleau/projetIHM2022FI2/API/Groupe.class new file mode 100644 index 0000000000000000000000000000000000000000..7bcf3e01f0c0c7c62e0f4414374632bb00bc5d70 GIT binary patch literal 2368 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 Ne$11m4DGdH>>pFLvoiny literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.class b/build/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.class new file mode 100644 index 0000000000000000000000000000000000000000..55683c49b14415aabde28774372826e770396995 GIT binary patch literal 6206 zcmbtY349dg75{%^li6$r&`8uM!4Xgb2??eZg#?92A&MY&t5jMy^{e)INy@BQEZ zz3NU$5YXIBra!5}W1yP4aTHG;~WG zABf}DIBt`ot);jfcO-b>&O76{OCq{ke)GXNJ`~4?cKBC~G3Dn`faz^uD z8CK&Vsrhgjy75RE*5Kpv@~DFCQv3<2utULPaeOk4PsQ{QSvP@Hw_j4d#&rQ4}Db6$66+R$_Ll&&+pxR!N#uU?&+^;ScC*LQy_{nRTyU^P zQy@y~R!@D>@{AtCX&kxpxpYv{WLl;-SKx%|h^=&kRC5_nldtx>7;Ef?Wy* z1j_VOYK5H-zvE~uAGuH$dbyOTTVA6qg)u3|&Mso2^3G)9@*1p!Ny8LTm~p?b+YPT# z!ES-&M^SUu(u?%|zW-YTc%h0k$&eO8Gt93bhcNmVAld}AI z(zKLqd0N`gEIXqauBTbKbXvjZRD2%Kuw5O#2$r_Ch25&PO?u@eiSq=GJ*Z!)I3F!4 zp2c$tzM$fZ*sJ1sd`ZQZ@q&V{NXb_PS`L70SZSlz$E@}EP0@#^b?Hv9u%<}JGPs!Kk>4TJ>xCRn(-<2T7VEt%H3nQBe;4%4Nx1KOyT<#8EO^MwX`QhxJ> zoT1IonzW2*X-#vqjJ{DO_YxJ~$18l)L^1ikgAQ#;Z-Z2Z@d(^HR6Tm!@~$Nl+-aGT z+d>SkP1+oT!4(`7YKK`!8LpdiYc*eSh?;+z^ZPWz@>T7eTPHBnPh+N&d1d(x?s9qL z=`Kh(n~2%v8S)^IFqhnRO9n1d@B@kD^z;4a-&5)v1JO+Y4H3ydf$ z=;MsE-bl&$jgLANf50ClN9-R{3Ju^w%gtr8w&NM8Wjv$0Y)p|xFiy5QgKda8H8WZE zGjHz>cKX9JBfIn=o)=7F!TGYzbw-!Res*|slIUU04KWtXI2;S21h}+bUJxYNBy@Ib z&RGQ^$q^{3mLo;vF%n?o7%|2%Hpu4MYFn*-w>mpIE(B_g2hUp3*)mk(kjkkbnex3Q z^WLKKvVhX7r*p=#Zh_;glTjP_iJF_UIRZWciqK`$!XSz=*}FOCyXPC51S*CJXX?d6 z(1o+H#B_1gVq|9S494e`61^WEEex?7q{koJN=T@lCbbIbXg9CmhS6NL*`^g-m{-Th z*u4fP5O=Zv96riPn%+wS69T6X7hoh|gS<#MD>h{bXU2$TeyJOvPxv!a zBUTG`iHyG9m~UHMy0^;o)^g=~Jlo94lqg$a(uNdbD5E8!@XPdIF8#Aa4u>2v0*{-6 z2k`hIU*``db(FQb+iGlNiN`GeV_aU-4{$JB@`pygYjYYny1|(BQN(P^8XXecpmm;l zS%3uxB~)*-x&rj>FYcK=%L^BZD2%dLKbSsrM+{wYlVVX`P6GJx2>KR7;l8Am7dGvUPCg$tu zbUPErA4~f<(;XDwaM%PU99|En^1aJq2rR)U{&9%si;+=sW~Xeazivf>YtHz*E~msq z316oGbEfq})Rd3fg`!o{_8`_#Grp=H#XC{LJEfx^@tr80_O$>X31uX#BWxBEA@xgt%WOiIT>vYRXTMxNFO`;ozSd zBAqDk6ejgyaz2F9;YivIlh?Eb{u#ftnoY!y>raUGq^jvn4J~VH` z*jjlzk0`dIWc&VCYh^bJ@;resz;_;TyhH#mV-{ag%;S58g?taN1h4pj#-ivyI6*-- znV-Io8-oVlLr&JRtp^|{hAl9$2lG417xZJ{vosv^>Y%&69`0L5&GkNjH2%&{`Iz`C T{)xYliTimU=l#d{|G@tMv-;V0 literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.class b/build/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.class new file mode 100644 index 0000000000000000000000000000000000000000..10825aab51cc50c7b503eb8b7285528dd5560ce6 GIT binary patch literal 1397 zcmbVM%Wl&^6g`ut6HFhW4_XSCQcB_`bqNJ3r9$*UAyS)GDxzYC<4l92bR1l}V$YAT zt;B*?1Y*IaJ3b0=$BEJ?LY2iL=Vm77oVoXSoZo+b{sQm_57SU_N5Om=cac?)Q=q4C z2@4YP5(*L)B^XI8C2=o_B11y(cV4;1z{(5}TYfPa^zB2}uzl~a+T^Bhv|Ojbz4G&& z;!?4=RW2H9du8L9>-a5RB0-ftoFN}V^wjffwkbT4C01==dyg63XF~|Pr-fkljtIf+ zy5?Ro#5SB74KciJ3tsV$s@#2H()0}RI*m@bM6)@HC`PL_nl+mXZ{Ja^)5s*I_81mJ z$$OJ9D63Yp8yEFK?WXq~-?jLbEn6Jjcw>q>KjOlx>@7CT6H~mfWfb4^%t*puP2N&m*4jo6RKdt60VZhRy#ob9uwDMa|`b z9mA6_HkKnS?h3jova_?(?zIUlR19HQ#fXGaWK>*{Foto;_2O&0Q`s~6qhc75VHr(I z&)BUtxaHBKz1Txu{c{h>K5+0oyV-R(W*BlgMd;t%cAQCUyz8se)ScJHj?^68;V|NBcQiNmVHcnkl(3z98 zKZPu&QNT46F+=}E*NHt%tIp|i#Yh#`zajatXC+$%<_Kp3fo!y&s(c!t=81aapVZVK ob(yF)p%D(crU$93P$=QqJ}MoHc$9)TAG_1*5Rq=vj}grM1&}>N!~g&Q literal 0 HcmV?d00001 diff --git a/build/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.class b/build/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.class new file mode 100644 index 0000000000000000000000000000000000000000..7eddb629333f9b3d65532090947a01a272bbca3c GIT binary patch literal 916 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 M|MdJTy<0u_|JpSWtN;K2 literal 0 HcmV?d00001 diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java new file mode 100644 index 0000000..4acea36 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java @@ -0,0 +1,55 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des changements. + * + * + */ + +public interface AbstractChangementFactory { + + /** + * permet de récupérer une usine abstraite pour les groupes qui fonctionne en tandem avec cette usine abstraite + * @return cette usine abstraite pour les groupes + */ + public AbstractGroupeFactory getGroupeFactory(); + + /** + * permet de récupérer les changements + * @return l'ensemble de tous les changements en attente + * + * NB. Attention. C'était Iterator dans la version beta. + */ + public Set getAllChangements(); + + /** + * permet de mettre en oeuvre un changement connu de l'usine abstraite. + * En cas de succès, le changement est oublié (détruit). + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void applyChangement(Changement c); + + /** + * permet de supprimer un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void deleteChangement(Changement c); + + /** + * permet d'ajouter un nouveau changement. + * + * @param A groupe actuel + * @param B groupe demandé + * @param e étudiant concerné par le changement + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si les groupes ou l'étudiant ne sont pas connus de la factory partenaire, ou e n'appartient pas à A ou A et B ne sont pas frères dans l'arbre des groupes. + * + */ + public void createChangement(Groupe A, Etudiant e, Groupe B); + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java~ new file mode 100644 index 0000000..9c2c6b4 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractChangementFactory.java~ @@ -0,0 +1,44 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des changements. + * + * + */ + +public interface AbstractChangementFactory { + + /** + * permet de récupérer une usine abstraite pour les groupes qui fonctionne en tandem avec cette usine abstraite + * @return cette usine abstraite + */ + public AbstractGroupeFactory getGroupeFactory(); + + /** + * permet de récupérer les changements + * @return tous les changements en attente + */ + public Iterator getAllChangements(); + + /** + * permet de supprimer un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void deleteChangement(Changement c); + + /** + * permet d'ajouter un nouveau changement. + * + * @param A groupe actuel + * @param B groupe demandé + * @param e étudiant concerné par le changement + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si les groupes ou l'étudiant ne sont pas connus de la factory partenaire, ou e n'appartient pas à A ou A et B ne sont pas frères dans l'arbre des groupes. + * + */ + public void createChangement(Groupe A, Etudiant e, Groupe B); + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java new file mode 100644 index 0000000..63dc788 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java @@ -0,0 +1,115 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des groupes. + * + */ + +public interface AbstractGroupeFactory { + + /** + * permet de récupérer le Groupe qui contient les étudiants de toute la promotion + * @return la promo. + */ + public Groupe getPromotion(); + + + /** + * Test si le groupe g est connu de l'usine (connu maintenant). + * Si la réponse est true, les méthodes avec ce groupe en paramètre devraient bien fonctionner. + * Si la réponse est false, le comportement n'est pas garanti. + */ + public Boolean knows(Groupe g); + + + /** + * permet de supprimer un groupe connu de l'usine abstraite qui ne contient pas de groupes. + * Pour détruire un groupe connu qui en contient d'autres il faut le faire récursivement. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le groupe contient des groupes + * @throws java.lang.IllegalArgumentException si le groupe n'est pas connu de l'usine abstraite ou bien si le groupe est celui de toute la promotion (renvoyé par getPromotion) + */ + public void deleteGroupe(Groupe g); + + /** + * permet d'ajouter un groupe vide de type FREE comme sous-groupe d'un groupe donné. + * @param pere le groupe père du groupe à créer + * @param name le nom du groupe à créer + * @param min,max bornes indicatives sur la taille du groupe à créer + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou si il n'y a pas 0 < min <= max + */ + public void createGroupe(Groupe pere, String name, int min, int max); + + /** + * permet de créer une partition automatiquement sous un groupe donné. + * + * @param pere le groupe père du groupe à partitionner + * @param name le nom des groupe à créer (on ajoutera à la suite un numéro ou une lettre pour distinguer chaque groupe) + * @param n le nombre de partitions + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou n négatif ou nul + * + * NB. doit créer une "copie" de pere + * sous pere de type Partition et ajouter sous ce groupe, n groupes de type "FREE". + * les valeurs min et max de ces n groupes sont + * min = 0 et + * max = partie entière de N/n plus 1, où N est le nombre max du groupe pere. + */ + public void createPartition(Groupe pere, String name, int n); + + /** + * permet d'ajouter un étudiant à un groupe. + * + * @param g le groupe dans lequel il faut ajouter l'étudiant + * @param e l'étudiant à ajouter + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + * @throws java.lang.IllegalStateException le père de g ne contient pas e + */ + public void addToGroupe(Groupe g, Etudiant e); + + /** + * permet d'enlever un étudiant d'un groupe. + * + * @param g le groupe dans lequel il faut enlever l'étudiant + * @param e l'étudiant à enlever + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException g ne contient pas e + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + */ + public void dropFromGroupe(Groupe g, Etudiant e); + + /** + * permet de retrouver un étudiant à partir d'un String. + * + * NB. dans une version simple il doit s'agir du nom exact. + * dans une version un peu plus complexe, il s'agit des premières lettres du nom + * dans une version avancée, on peut autoriser une expression régulière plus ou moins complexe qui est générée si la première recherche n'a pas renvoyé de candidat. + * + * @param String nomEtu le nom approximmatif de l'étudiant + * @return Set l'ensemble des étudiants connus de la factory ayant un nom "proche" de ce string au sens de la remarque ci-dessus. + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getEtudiants(String nomEtu); + + /** + * permet de retrouver les groupes d'un étudiant. + * + * @param Etu un étudiant + * @return Etudiant l'étudiant connu de la factory ayant cet identifiant + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getGroupesOfEtudiant(Etudiant etu); + + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java~ new file mode 100644 index 0000000..946dff7 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/AbstractGroupeFactory.java~ @@ -0,0 +1,106 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des groupes. + * + */ + +public interface AbstractGroupeFactory { + + /** + * permet de récupérer le Groupe qui contient les étudiants de toute la promotion + * @return la promo. + */ + public Groupe getPromotion(); + + /** + * permet de supprimer un groupe connu de l'usine abstraite qui ne contient pas de groupes. + * Pour détruire un groupe connu qui en contient d'autres il faut le faire récursivement. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le groupe contient des groupes + * @throws java.lang.IllegalArgumentException si le groupe n'est pas connu de l'usine abstraite ou bien si le groupe est celui de toute la promotion (renvoyé par getPromotion) + */ + public void deleteGroupe(Groupe g); + + /** + * permet d'ajouter un groupe vide de type FREE comme sous-groupe d'un groupe donné. + * @param pere le groupe père du groupe à créer + * @param name le nom du groupe à créer + * @param min,max bornes indicatives sur la taille du groupe à créer + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou si il n'y a pas 0 < min <= max + */ + public void createGroupe(Groupe pere, String name, int min, int max); + + /** + * permet de créer une partition automatiquement sous un groupe donné. + * + * @param pere le groupe père du groupe à partitionner + * @param name le nom des groupe à créer (on ajoutera à la suite un numéro ou une lettre pour distinguer chaque groupe) + * @param n le nombre de partitions + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou n négatif ou nul + * + * NB. doit créer une "copie" de pere + * sous pere de type Partition et ajouter sous ce groupe, n groupes de type "FREE". + * les valeurs min et max de ces n groupes sont + * min = 0 et + * max = partie entière de N/n plus 1, où N est le nombre max du groupe pere. + */ + public void createPartition(Groupe pere, String name, int n); + + /** + * permet d'ajouter un étudiant à un groupe. + * + * @param g le groupe dans lequel il faut ajouter l'étudiant + * @param e l'étudiant à ajouter + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + * @throws java.lang.IllegalStateException le père de g ne contient pas e + */ + public void addToGroupe(Groupe g, Etudiant e); + + /** + * permet d'enlever un étudiant d'un groupe. + * + * @param g le groupe dans lequel il faut enlever l'étudiant + * @param e l'étudiant à enlever + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException g ne contient pas e + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + */ + public void dropFromGroupe(Groupe g, Etudiant e); + + /** + * permet de retrouver un étudiant à partir d'un String. + * + * NB. dans une version simple il doit s'agir du nom exact. + * dans une version un peu plus complexe, il s'agit des premières lettres du nom + * dans une version avancée, on peut autoriser une expression régulière plus ou moins complexe qui est générée si la première recherche n'a pas renvoyé de candidat. + * + * @param String nomEtu le nom approximmatif de l'étudiant + * @return Set l'ensemble des étudiants connus de la factory ayant un nom "proche" de ce string au sens de la remarque ci-dessus. + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getEtudiants(String nomEtu); + + /** + * permet de retrouver les groupes d'un étudiant. + * + * @param Etu un étudiant + * @return Etudiant l'étudiant connu de la factory ayant cet identifiant + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getGroupesOfEtudiant(Etudiant etu); + + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java b/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java new file mode 100644 index 0000000..9b8bab4 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java @@ -0,0 +1,49 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Une demande de changement de groupe + * concerne un étudiant, qui est dans un groupe A et veut aller dans un groupe B. + * + */ + +public interface Changement extends MonPrint { + + /** + * permet de récupérer l'identifiant du changement (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer le groupe de depart + * @return ce groupe. + */ + public Groupe getA(); + + /** + * permet de récupérer le groupe d'arrivée + * @return ce groupe. + */ + public Groupe getB(); + + /** + * permet de récupérer l'étudiant demandant le changement + * @return cet étudiant + */ + public Etudiant getEtu(); + + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + * + * NB2. On ne peut pas utiliser le toString de Objects + * https://stackoverflow.com/questions/24016962/java8-why-is-it-forbidden-to-define-a-default-method-for-a-method-from-java-lan + */ + public default String monPrint() { + StringBuilder sb = new StringBuilder(); + sb.append("Changement de " + this.getEtu().monPrint() + " depuis le groupe " + this.getA().getName() + " vers le groupe " + this.getB().getName()); + return sb.toString(); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java~ new file mode 100644 index 0000000..1b0d88d --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Changement.java~ @@ -0,0 +1,49 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Une demande de changement de groupe + * concerne un étudiant, qui est dans un groupe A et veut aller dans un groupe B. + * + */ + +public interface Changement extends MonPrint { + + /** + * permet de récupérer l'identifiant du changement (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer le groupe de depart + * @return ce groupe. + */ + public Groupe getA(); + + /** + * permet de récupérer le groupe d'arrivée + * @return ce groupe. + */ + public Groupe getB(); + + /** + * permet de récupérer l'étudiant demandant le changement + * @return cet étudiant + */ + public Etudiant getEtu(); + + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + * + * NB2. On ne peut pas utiliser le toString de Objects + * https://stackoverflow.com/questions/24016962/java8-why-is-it-forbidden-to-define-a-default-method-for-a-method-from-java-lan + */ + public default String monPrint() { + StringBuilder sb = new StringBuilder(); + sb.append("Changement de " + this.getEtu().monPrint() + " depuis le groupe " + this.getA().getName() + " vers le groupe " + this.getA().getName()); + return sb.toString(); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java b/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java new file mode 100644 index 0000000..a31828b --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java @@ -0,0 +1,33 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +/** + * Un étudiant + */ + +public interface Etudiant extends MonPrint{ + + /** + * permet de récupérer l'identifiant de l'étudiant. + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer + * @return le nom de l'étudiant. + */ + public String getNom(); + + /** + * permet de récupérer + * @return le prénom de l'étudiant + */ + public String getPrenom(); + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + */ + public default String monPrint() { + return String.format("Nom " + getNom() + " Prenom " + getPrenom() + " (id="+getId()+")"); + } +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java~ new file mode 100644 index 0000000..e7334a6 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Etudiant.java~ @@ -0,0 +1,33 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +/** + * Un étudiant + */ + +public interface Etudiant extends MonPrint{ + + /** + * permet de récupérer l'identifiant de l'étudiant (qu'on suppose être le même pour les différents systèmes, internes et externes à l'hôtel). + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer + * @return le nom de l'étudiant. + */ + public String getNom(); + + /** + * permet de récupérer + * @return le prénom de l'étudiant + */ + public String getPrenom(); + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + */ + public default String monPrint() { + return String.format("Nom " + getNom() + " Prenom " + getPrenom() + " (id="+getId()+")"); + } +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java b/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java new file mode 100644 index 0000000..0d24d4b --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java @@ -0,0 +1,121 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Un groupe + */ + +public interface Groupe extends MonPrint { + /** + * Ajoute un étudiant. Se comporte comme add de l'interface Set. + * + * @return true iff e est ajouté + */ + public boolean addEtudiant(Etudiant e); + + /** + * Enlève un étudiant. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + boolean removeEtudiant(Etudiant e); + + /** + * Ajoute un sous-groupe. Se comporte comme add de l'interface Set. + * vérifie que le groupe passé en argument a bien renseigné this comme son père. + * + * @return true iff g est ajouté + */ + public boolean addSousGroupe(Groupe g); + + /** + * Enlève un groupe. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + public boolean removeSousGroupe(Groupe g); + + /** + * permet de récupérer l'identifiant d'un groupe (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer le nom d'un groupe (utile irl). + * @return le nom. + */ + public String getName(); + + /** + * permet de récupérer le nombre minimum d'étudiants souhaités dans le groupe. + * @return le minimum souhaité + */ + public int getMin(); + + /** + * permet de récupérer le nombre maximum d'étudiants souhaités dans un groupe. + * @return le maximum souhaité + */ + public int getMax(); + + /** + * permet de récupérer le nombre d'étudiants dans ce groupe. + * @return le nombre de places prises (pas forcément limité entre Min et Max, mais c'est le but) + */ + public int getSize(); + + /** + * permet de récupérer la nature du groupe + * @return le type du groupe + */ + public TypeGroupe getType(); + + /** + * permet de récupérer le groupe père + * un groupe racine devrait retourner lui-même + * + * @return le père + */ + public Groupe getPointPoint(); + + /** + * Potentiellement "vide" + * @return l'ensemble des sous-groupes. + */ + public Set getSousGroupes(); + + /** + * Potentiellement "vide" + * @return l'ensemble des étudiants. + */ + public Set getEtudiants(); + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + * + * NB2. On ne peut pas utiliser le toString de Objects + * https://stackoverflow.com/questions/24016962/java8-why-is-it-forbidden-to-define-a-default-method-for-a-method-from-java-lan + */ + public default String monPrint() { + StringBuilder sb = new StringBuilder(); + sb.append("Groupe " + getName() + " (" + getType() + ", capacité " + getMin() + " à " + getMax() +", id " + getId()+")"); + sb.append("\n"); + // NB. getEtudiants() retourne un Set qui étend Iterable + // On peut utiliser les mécanismes de boucle "moderne" de puis la version 8 + // pour se faciliter la vie quand le traitement est assez simple + // voir https://docs.oracle.com/javase/8/docs/technotes/guides/language/foreach.html + sb.append(" ** Étudiants **\n"); + for (Etudiant s: getEtudiants()){ + sb.append("\t _ "+ s.monPrint()); + sb.append("\n"); + } + sb.append(" ** Sous Groupes **\n"); + for (Groupe g: getSousGroupes()){ + sb.append("\t _ "+ g.getName() + " (" + g.getType() + ", capacité " + g.getMin() + " à " + g.getMax() +", id " + g.getId()+")"); + sb.append("\n"); + } + return sb.toString(); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java~ new file mode 100644 index 0000000..cb397fa --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/Groupe.java~ @@ -0,0 +1,121 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Un groupe + */ + +public interface Groupe extends MonPrint { + /** + * Ajoute un étudiant. Se comporte comme add de l'interface Set. + * + * @return true iff e est ajouté + */ + public boolean addEtudiant(Etudiant e); + + /** + * Enlève un étudiant. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + boolean removeEtudiant(Etudiant e); + + /** + * Ajoute un sous-groupe. Se comporte comme add de l'interface Set. + * vérifie que le groupe passé en argument a bien renseigné this comme son père. + * + * @return true iff g est ajouté + */ + public boolean addSousGroupe(Groupe g); + + /** + * Enlève un groupe. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + public boolean removeSousGroupe(Groupe g); + + /** + * permet de récupérer l'identifiant d'un groupe (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(); + + /** + * permet de récupérer le nom d'un groupe (utile irl). + * @return le nom. + */ + public String getName(); + + /** + * permet de récupérer le nombre minimum d'étudiants souhaités dans le groupe. + * @return le minimum souhaité + */ + public int getMin(); + + /** + * permet de récupérer le nombre maximum d'étudiants souhaités dans un groupe. + * @return le maximum souhaité + */ + public int getMax(); + + /** + * permet de récupérer le nombre d'étudiants dans ce groupe. + * @return le nombre de places prises (pas forcément limité entre Min et Max, mais c'est le but) + */ + public int getSize(); + + /** + * permet de récupérer la nature du groupe + * @return le type du groupe + */ + public TypeGroupe getType(); + + /** + * permet de récupérer le groupe père + * un groupe racine devrait retourner lui-même + * + * @return le père + */ + public Groupe getPointPoint(); + + /** + * Potentiellement "vide" + * @return l'ensemble des sous-groupes. + */ + public Set getSousGroupes(); + + /** + * Potentiellement "vide" + * @return l'ensemble des étudiants. + */ + public Set getEtudiants(); + + /** + * @see MonPrint + * NB. On n'utilise le mécanisme des méthodes par défaut pour donner du code dans une interface. C'est un petit peu laid et à contre-emploi mais pratique ici. + * + * NB2. On ne peut pas utiliser le toString de Objects + * https://stackoverflow.com/questions/24016962/java8-why-is-it-forbidden-to-define-a-default-method-for-a-method-from-java-lan + */ + public default String monPrint() { + StringBuilder sb = new StringBuilder(); + sb.append("Groupe " + getName() + " (" + getType() + ", capacité " + getMin() + " à " + getMax() +", id " + getId()+")"); + sb.append("\n"); + // NB. getEtudiants() retourne un Set qui étend Iterable + // On peut utiliser les mécanismes de boucle "moderne" de puis la version 8 + // pour se faciliter la vie quand le traitement est assez simple + // voir https://docs.oracle.com/javase/8/docs/technotes/guides/language/foreach.html + sb.append(" ** Étudiants **\n"); + for (Etudiant s: getEtudiants()){ + sb.append("\t _ "+ s.monPrint()); + sb.append("\n"); + } + sb.append(" ** Sous Groupess **\n"); + for (Groupe g: getSousGroupes()){ + sb.append("\t _ "+ g.getName() + " (" + g.getType() + ", capacité " + g.getMin() + " à " + g.getMax() +", id " + g.getId()+")"); + sb.append("\n"); + } + return sb.toString(); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java b/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java new file mode 100644 index 0000000..7f8d663 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java @@ -0,0 +1,12 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +/** + * Toutes nos interfaces vont étendre cette interface. + */ +public interface MonPrint { + + /** + * Fonctionne comme ToPrint() sauf car une interface n'a pas le droit de faire un override sur ToPrint(). + * Toutes nos interfaces vont étendre cette interface. + */ + public String monPrint(); +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java~ new file mode 100644 index 0000000..e5fafae --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/MonPrint.java~ @@ -0,0 +1,7 @@ +public interface MonPrint{ + + /** + * Fonctionne comme ToPrint() sauf car une interface n'a pas le droit de faire un override sur ToPrint(); + */ + public String monPrint(); +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java b/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java new file mode 100644 index 0000000..b9d9080 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java @@ -0,0 +1,10 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +public enum TypeGroupe { + ROOT ("Tous les étudiants"), PARTITION ("partition"), FREE ("libre") ; + + private final String name; + + private TypeGroupe(String s) { + name = s; + } +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java~ b/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java~ new file mode 100644 index 0000000..902843e --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/API/TypeGroupe.java~ @@ -0,0 +1,10 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +public enum TypeGroupe { + ROOT ("Tous les étudiants"), PARTITION ("partitionable"), FREE ("libre") ; + + private final String name; + + private TypeGroupe(String s) { + name = s; + } +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java new file mode 100644 index 0000000..a586c32 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java @@ -0,0 +1,104 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des changements. + * + */ + +public class AbstractChangementFactoryNP implements AbstractChangementFactory { + + // l'usine à groupe travaillant en tandem avec cette usine. + private AbstractGroupeFactory agf; + + // On utilise une table de hachage pour retrouver facilement un changement (à partir de son id). + // Si il y a beaucoup de changements c'est plus rapide que de parcourir toute une liste. + private HashMap brain; + + public AbstractChangementFactoryNP(AbstractGroupeFactory agf){ + Objects.requireNonNull(agf,"On ne peut pas créer une usine à changement dont l'usine à groupe parternaire est null"); + this.agf=agf; + this.brain=new HashMap(); + } + + + /** + * permet de récupérer l'usine abstraite pour les groupes qui fonctionne en tandem avec cette usine abstraite + * @return cette usine abstraite pour les groupes + */ + public AbstractGroupeFactory getGroupeFactory(){ + return this.agf; + } + + /** + * permet de récupérer les changements + * @return l'ensemble de tous les changements en attente + */ + public Set getAllChangements(){ + // la méthode value() d'un hashmap retourne la collection des valeurs. + // Il faut transformer la collection en Set. + // Un constructeur de HashSet permet de faire cette opération. + Set out = new HashSet(this.brain.values()); + return out; + } + + /** + * permet de mettre en oeuvre un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le changement n'a pas de sens en l'état actuel (e.g. étudiant pas dans le groupe de départ a, groupe b inconnu, groupe a inconnu, etc). + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void applyChangement(Changement c){ + Objects.requireNonNull(c,"On ne peut pas appliquer un changement qui est null"); + Etudiant e = c.getEtu(); + Groupe a = c.getA(); + Groupe b = c.getB(); + + if (!agf.knows(a)) throw new IllegalStateException("Le groupe de départ du changement est inconnu. Impossible à mettre en oeuvre."); + + if (!agf.knows(b)) throw new IllegalStateException("Le groupe d'arrivée du changement est inconnu. Impossible à mettre en oeuvre."); + // pas encore implanté. + // if(!agf.getGroupesOfEtudiant(e).contains(a)) throw new IllegalStateException("Le groupe de départ ne contient pas l'étudiant. Impossible à mettre en oeuvre."); + + agf.dropFromGroupe(a,e); + agf.addToGroupe(b,e); + // En cas de succès, on enlève le changement du cerveau + this.brain.remove(Integer.valueOf(c.getId())); + } + + + /** + * permet de supprimer un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void deleteChangement(Changement c){ + Objects.requireNonNull(c,"On ne peut pas demander la suppression d'un changement qui est null"); + + this.brain.remove(Integer.valueOf(c.getId())); + + } + + /** + * permet d'ajouter un nouveau changement. + * + * @param A groupe actuel + * @param B groupe demandé + * @param e étudiant concerné par le changement + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si les groupes ou l'étudiant ne sont pas connus de la factory partenaire, ou e n'appartient pas à A ou A et B ne sont pas frères dans l'arbre des groupes. + * + */ + public void createChangement(Groupe A, Etudiant e, Groupe B){ + Objects.requireNonNull(A,"Le groupe d'origine ne peut pas être null"); + Objects.requireNonNull(B,"Le groupe d'arrivée ne peut pas être null"); + Objects.requireNonNull(e,"L'étudiant ne peut pas être null"); + + Changement c = new ChangementNP(A,e,B); + this.brain.put(Integer.valueOf(c.getId()),c); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java~ new file mode 100644 index 0000000..7e73e9e --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractChangementFactoryNP.java~ @@ -0,0 +1,101 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des changements. + * + */ + +public class AbstractChangementFactoryNP implements AbstractChangementFactory { + + // l'usine à groupe travaillant en tandem avec cette usine. + private AbstractGroupeFactory agf; + + // On utilise une table de hachage pour retrouver facilement un changement (à partir de son id). + // Si il y a beaucoup de changements c'est plus rapide que de parcourir toute une liste. + private HashMap brain; + + public AbstractChangementFactoryNP(AbstractGroupeFactory agf){ + Objects.requireNonNull(agf,"On ne peut pas créer une usine à changement dont l'usine à groupe parternaire est null"); + this.agf=agf; + this.brain=new HashMap(); + } + + + /** + * permet de récupérer l'usine abstraite pour les groupes qui fonctionne en tandem avec cette usine abstraite + * @return cette usine abstraite pour les groupes + */ + public AbstractGroupeFactory getGroupeFactory(){ + return this.agf; + } + + /** + * permet de récupérer les changements + * @return l'ensemble de tous les changements en attente + */ + public Set getAllChangements(){ + // la méthode value() d'un hashmap retourne la collection des valeurs. + // Il faut transformer la collection en Set. + // Un constructeur de HashSet permet de faire cette opération. + Set out = new HashSet(this.brain.values()); + return out; + } + + /** + * permet de mettre en oeuvre un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le changement n'a pas de sens en l'état actuel (e.g. étudiant pas dans le groupe de départ a, groupe b inconnu, groupe a inconnu, etc). + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void applyChangement(Changement c){ + Objects.requireNonNull(c,"On ne peut pas appliquer un changement qui est null"); + Etudiant e = c.getEtu(); + Groupe a = c.getA(); + Groupe b = c.getB(); + + if (!agf.knows(a)) throw new IllegalStateException("Le groupe de départ du changement est inconnu. Impossible à mettre en oeuvre."); + + if (!agf.knows(b)) throw new IllegalStateException("Le groupe d'arrivée du changement est inconnu. Impossible à mettre en oeuvre."); + // pas encore implanté. + // if(!agf.getGroupesOfEtudiant(e).contains(a)) throw new IllegalStateException("Le groupe de départ ne contient pas l'étudiant. Impossible à mettre en oeuvre."); + + agf.dropFromGroupe(a,e); + agf.addToGroupe(b,e); + // En cas de succès, on enlève le changement du cerveau + this.brain.remove(Integer.valueOf(c.getId())); + } + + + /** + * permet de supprimer un changement connu de l'usine abstraite. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si inconnu de l'usine abstraite + */ + public void deleteChangement(Changement c){ + throw new UnsupportedOperationException("pas encore implanté"); + } + + /** + * permet d'ajouter un nouveau changement. + * + * @param A groupe actuel + * @param B groupe demandé + * @param e étudiant concerné par le changement + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si les groupes ou l'étudiant ne sont pas connus de la factory partenaire, ou e n'appartient pas à A ou A et B ne sont pas frères dans l'arbre des groupes. + * + */ + public void createChangement(Groupe A, Etudiant e, Groupe B){ + Objects.requireNonNull(A,"Le groupe d'origine ne peut pas être null"); + Objects.requireNonNull(B,"Le groupe d'arrivée ne peut pas être null"); + Objects.requireNonNull(e,"L'étudiant ne peut pas être null"); + + Changement c = new ChangementNP(A,e,B); + this.brain.put(Integer.valueOf(c.getId()),c); + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupFactoryNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupFactoryNP.java~ new file mode 100644 index 0000000..f1dbec9 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupFactoryNP.java~ @@ -0,0 +1,106 @@ +package fr.iutfbleau.projetIHM2022FI2.API; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des groupes. + * + */ + +public interface AbstractGroupeFactory { + + /** + * permet de récupérer le Groupe qui contient les étudiants de toute la promotion + * @return la promo. + */ + public Groupe getPromotion(); + + /** + * permet de supprimer un groupe connu de l'usine abstraite qui ne contient pas de groupes. + * Pour détruire un groupe connu qui en contient d'autres il faut le faire récursivement. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le groupe contient des groupes + * @throws java.lang.IllegalArgumentException si le groupe n'est pas connu de l'usine abstraite ou bien si le groupe est celui de toute la promotion (renvoyé par getPromotion) + */ + public void deleteGroupe(Groupe g); + + /** + * permet d'ajouter un groupe vide de type FREE comme sous-groupe d'un groupe donné. + * @param pere le groupe père du groupe à créer + * @param name le nom du groupe à créer + * @param min,max bornes indicatives sur la taille du groupe à créer + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou si il n'y a pas 0 < min <= max + */ + public void createGroupe(Groupe pere, String name, int min, int max); + + /** + * permet de créer une partition automatiquement sous un groupe donné. + * + * @param pere le groupe père du groupe à partitionner + * @param name le nom des groupe à créer (on ajoutera à la suite un numéro ou une lettre pour distinguer chaque groupe) + * @param n le nombre de partitions + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou n négatif ou nul + * + * NB. doit créer une "copie" de pere + * sous pere de type Partition et ajouter sous ce groupe, n groupes de type "FREE". + * les valeurs min et max de ces n groupes sont + * min = 0 et + * max = partie entière de N/n plus 1, où N est le nombre max du groupe pere. + */ + public void createPartition(Groupe pere, String name, int n); + + /** + * permet d'ajouter un étudiant à un groupe. + * + * @param g le groupe dans lequel il faut ajouter l'étudiant + * @param e l'étudiant à ajouter + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + * @throws java.lang.IllegalStateException le père de g ne contient pas e + */ + public void addToGroupe(Groupe g, Etudiant e); + + /** + * permet d'enlever un étudiant d'un groupe. + * + * @param g le groupe dans lequel il faut enlever l'étudiant + * @param e l'étudiant à enlever + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException g ne contient pas e + * @throws java.lang.IllegalArgumentException la factory ne connaît pas g + */ + public void dropFromGroupe(Groupe g, Etudiant e); + + /** + * permet de retrouver un étudiant à partir d'un String. + * + * NB. dans une version simple il doit s'agir du nom exact. + * dans une version un peu plus complexe, il s'agit des premières lettres du nom + * dans une version avancée, on peut autoriser une expression régulière plus ou moins complexe qui est générée si la première recherche n'a pas renvoyé de candidat. + * + * @param String nomEtu le nom approximmatif de l'étudiant + * @return Set l'ensemble des étudiants connus de la factory ayant un nom "proche" de ce string au sens de la remarque ci-dessus. + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getEtudiantFromId(String nomEtu); + + /** + * permet de retrouver les groupes d'un étudiant. + * + * @param Etu un étudiant + * @return Etudiant l'étudiant connu de la factory ayant cet identifiant + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getGroupesOfEtudiant(Etudiant etu); + + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java new file mode 100644 index 0000000..4f3264e --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java @@ -0,0 +1,225 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des groupes. + * + */ + +public class AbstractGroupeFactoryNP implements AbstractGroupeFactory { + + // la racine (promotion) + private Groupe promo; + + // On utilise une table de hachage pour retrouver facilement un groupe (à partir de son id). + // Si il y a beaucoup de groupes c'est plus rapide que de parcourir toute une liste. + private HashMap brain; + + + + + /** + * Le constructeur fabrique le groupe promotion vide. + * Il faut ensuite y ajouter les étudiants. + */ + public AbstractGroupeFactoryNP(String name, int min, int max){ + Objects.requireNonNull(name,"On ne peut pas créer une promotion dont le nom est null"); + this.promo=new GroupeNP(name,min,max); + this.brain=new HashMap(); + this.brain.put(Integer.valueOf(this.promo.getId()),this.promo); + } + + /** + * Test plutôt optimiste. Si la clé est identique alors on fait comme si c'était le bon groupe. + */ + public Boolean knows(Groupe g){ + return this.brain.containsKey(Integer.valueOf(g.getId())); + } + + + + /** + * permet de récupérer le Groupe qui contient les étudiants de toute la promotion + * @return la promo. + */ + public Groupe getPromotion(){ + return this.promo; + } + + /** + * permet de supprimer un groupe connu de l'usine abstraite qui ne contient pas de groupes. + * Pour détruire un groupe connu qui en contient d'autres il faut le faire récursivement. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le groupe contient des groupes + * @throws java.lang.IllegalArgumentException si le groupe n'est pas connu de l'usine abstraite ou bien si le groupe est celui de toute la promotion (renvoyé par getPromotion) + */ + public void deleteGroupe(Groupe g){ + Objects.requireNonNull(g,"On ne peut pas enlever un groupe null car null n'est pas un groupe autorisé"); + if (!this.knows(g)){ + throw new IllegalArgumentException("Impossible d'enlever un groupe inconnu"); + } + if (this.getPromotion().equals(g)){ + throw new IllegalArgumentException("Impossible de détruire le groupe de toute la promotion"); + } + if (g.getSize()>0){ + throw new IllegalStateException("Impossible de détruire un groupe contenant un groupe"); + } + g.getPointPoint().removeSousGroupe(g); + this.brain.remove(Integer.valueOf(g.getId())); + } + + /** + * permet d'ajouter un groupe vide de type FREE comme sous-groupe d'un groupe donné. + * @param pere le groupe père du groupe à créer + * @param name le nom du groupe à créer + * @param min,max bornes indicatives sur la taille du groupe à créer + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou si il n'y a pas 0 < min <= max + */ + public void createGroupe(Groupe pere, String name, int min, int max){ + Objects.requireNonNull(pere,"Le groupe pere ne peut pas être null"); + Objects.requireNonNull(name,"Le nouveau groupe ne peut pas avoir null comme nom"); + if (!this.knows(pere)){ + throw new IllegalArgumentException("Interdit d'ajouter un fils à un groupe inconnu"); + } + if (pere.getType().equals(TypeGroupe.PARTITION)){ + throw new IllegalArgumentException("Impossible d'ajouter un groupe à une parition. Il faut utiliser createPartition pour créer une partition"); + } + if ( min <= 0 || max < min){ + throw new IllegalArgumentException("Il faut que 0 < min <= max"); + } + Groupe g = new GroupeNP(pere,name,min,max); + pere.addSousGroupe(g); + this.brain.put(Integer.valueOf(g.getId()),g); + } + + /** + * permet de créer une partition automatiquement sous un groupe donné. + * + * @param pere le groupe père du groupe à partitionner + * @param name le nom des groupe à créer (on ajoute à la suite un numéro de 1 à n pour distinguer chaque groupe formant la partition) + * @param n le nombre de partitions + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou n négatif ou nul + * + * NB. doit créer une "copie" de pere + * sous pere de type Partition et ajouter sous ce groupe, n groupes de type "FREE". + * les valeurs min et max de ces n groupes sont + * min = 0 et + * max = partie entière de N/n plus 1, où N est le nombre max du groupe pere. + */ + public void createPartition(Groupe pere, String name, int n){ + Objects.requireNonNull(pere,"Le groupe pere ne peut pas être null"); + Objects.requireNonNull(name,"Le nouveau groupe ne peut pas avoir null comme nom"); + if (!this.knows(pere)){ + throw new IllegalArgumentException("Impossible de partitionner ce groupe inconnu"); + } + if (pere.getType().equals(TypeGroupe.PARTITION)){ + throw new IllegalArgumentException("Impossible de créer une partition à ce niveau. Il faut soit repartitionner le groupe au dessus, soit partitionner une partition en dessous."); + } + if ( n <= 0){ + throw new IllegalArgumentException("Le nombre de partitions doit être strictement positif"); + } + //Création de la racine de la partition. + Groupe copiePereRacinePartition = new GroupeNP(pere); + pere.addSousGroupe(copiePereRacinePartition); + this.brain.put(Integer.valueOf(copiePereRacinePartition.getId()),copiePereRacinePartition); + // création des sous-groupes + int min = 0; + int max = ((int) Math.floor(pere.getSize()/n))+1; + List groupes = new ArrayList(n); + for(int i = 0; i l'ensemble des étudiants connus de la factory ayant un nom "proche" de ce string au sens de la remarque ci-dessus. + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getEtudiants(String nomEtu){ + // on cherche bêtement dans la promo. + Set out = new LinkedHashSet(); + for (Etudiant e : getPromotion().getEtudiants()){ + if (e.getNom().equals(nomEtu)){ + out.add(e); + break; + } + } + return out; + } + + /** + * permet de retrouver les groupes d'un étudiant. + * + * @param Etu un étudiant + * @return Etudiant l'étudiant connu de la factory ayant cet identifiant + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getGroupesOfEtudiant(Etudiant etu){ + throw new UnsupportedOperationException("pas encore implanté"); + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java~ new file mode 100644 index 0000000..c86a834 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/AbstractGroupeFactoryNP.java~ @@ -0,0 +1,222 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Usine abstraite gérant l'ensemble des groupes. + * + */ + +public class AbstractGroupeFactoryNP implements AbstractGroupeFactory { + + // la racine (promotion) + private Groupe promo; + + // On utilise une table de hachage pour retrouver facilement un groupe (à partir de son id). + // Si il y a beaucoup de groupes c'est plus rapide que de parcourir toute une liste. + private HashMap brain; + + + + + /** + * Le constructeur fabrique le groupe promotion vide. + * Il faut ensuite y ajouter les étudiants. + */ + public AbstractGroupeFactoryNP(String name, int min, int max){ + Objects.requireNonNull(name,"On ne peut pas créer une promotion dont le nom est null"); + this.promo=new GroupeNP(name,min,max); + this.brain=new HashMap(); + this.brain.put(Integer.valueOf(this.promo.getId()),this.promo); + } + + + + + + + + + + + /** + * Test pltôt optimiste. Si la clé est identique alors on fait comme si c'était le bon groupe. + */ + private Boolean knows(Groupe g){ + return this.brain.containsKey(Integer.valueOf(g.getId())); + } + + + + /** + * permet de récupérer le Groupe qui contient les étudiants de toute la promotion + * @return la promo. + */ + public Groupe getPromotion(){ + return this.promo; + } + + /** + * permet de supprimer un groupe connu de l'usine abstraite qui ne contient pas de groupes. + * Pour détruire un groupe connu qui en contient d'autres il faut le faire récursivement. + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalStateException si le groupe contient des groupes + * @throws java.lang.IllegalArgumentException si le groupe n'est pas connu de l'usine abstraite ou bien si le groupe est celui de toute la promotion (renvoyé par getPromotion) + */ + public void deleteGroupe(Groupe g){ + Objects.requireNonNull(g,"On ne peut pas enlever un groupe null car null n'est pas un groupe autorisé"); + if (!this.knows(g)){ + throw new IllegalArgumentException("Impossible d'enlever un groupe inconnu"); + } + if (this.getPromotion().equals(g)){ + throw new IllegalArgumentException("Impossible de détruire le groupe de toute la promotion"); + } + if (g.getSize()>0){ + throw new IllegalStateException("Impossible de détruire un groupe contenant un groupe"); + } + g.getPointPoint().removeSousGroupe(g); + this.brain.remove(Integer.valueOf(g.getId())); + } + + /** + * permet d'ajouter un groupe vide de type FREE comme sous-groupe d'un groupe donné. + * @param pere le groupe père du groupe à créer + * @param name le nom du groupe à créer + * @param min,max bornes indicatives sur la taille du groupe à créer + * + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou si il n'y a pas 0 < min <= max + */ + public void createGroupe(Groupe pere, String name, int min, int max){ + Objects.requireNonNull(pere,"Le groupe pere ne peut pas être null"); + Objects.requireNonNull(name,"Le nouveau groupe ne peut pas avoir null comme nom"); + if (!this.knows(pere)){ + throw new IllegalArgumentException("Interdit d'ajouter un fils à un groupe inconnu"); + } + if (pere.getType().equals(TypeGroupe.PARTITION)){ + throw new IllegalArgumentException("Impossible d'ajouter un groupe à une parition. Il faut utiliser createPartition pour créer une partition"); + } + if ( min <= 0 || max < min){ + throw new IllegalArgumentException("Il faut que 0 < min <= max"); + } + Groupe g = new GroupeNP(pere,name,min,max); + pere.addSousGroupe(g); + this.brain.put(Integer.valueOf(g.getId()),g); + } + + /** + * permet de créer une partition automatiquement sous un groupe donné. + * + * @param pere le groupe père du groupe à partitionner + * @param name le nom des groupe à créer (on ajoute à la suite un numéro de 1 à n pour distinguer chaque groupe formant la partition) + * @param n le nombre de partitions + * @throws java.lang.NullPointerException si un argument est null + * @throws java.lang.IllegalArgumentException si le groupe pere est de type PARTITION + * ou n négatif ou nul + * + * NB. doit créer une "copie" de pere + * sous pere de type Partition et ajouter sous ce groupe, n groupes de type "FREE". + * les valeurs min et max de ces n groupes sont + * min = 0 et + * max = partie entière de N/n plus 1, où N est le nombre max du groupe pere. + */ + public void createPartition(Groupe pere, String name, int n){ + Objects.requireNonNull(pere,"Le groupe pere ne peut pas être null"); + Objects.requireNonNull(name,"Le nouveau groupe ne peut pas avoir null comme nom"); + if (!this.knows(pere)){ + throw new IllegalArgumentException("Impossible de partitionner ce groupe inconnu"); + } + if (pere.getType().equals(TypeGroupe.PARTITION)){ + throw new IllegalArgumentException("Impossible de créer une partition à ce niveau. Il faut soit repartitionner le groupe au dessus, soit partitionner une partition en dessous."); + } + if ( n <= 0){ + throw new IllegalArgumentException("Le nombre de partitions doit être strictement positif"); + } + //Création de la racine de la partition. + Groupe copiePereRacinePartition = new GroupeNP(pere); + pere.addSousGroupe(copiePereRacinePartition); + this.brain.put(Integer.valueOf(copiePereRacinePartition.getId()),copiePereRacinePartition); + // création des sous-groupes + int min = 0; + int max = ((int) Math.floor(pere.getSize()/n))+1; + for(int i = 0; i l'ensemble des étudiants connus de la factory ayant un nom "proche" de ce string au sens de la remarque ci-dessus. + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getEtudiants(String nomEtu){ + // on cherche bêtement dans la promo. + Set out = new LinkedHashSet(); + for (Etudiant e : getPromotion().getEtudiants()){ + if (e.getNom().equals(nomEtu)){ + out.add(e); + break; + } + } + return out; + } + + /** + * permet de retrouver les groupes d'un étudiant. + * + * @param Etu un étudiant + * @return Etudiant l'étudiant connu de la factory ayant cet identifiant + * + * @throws java.lang.NullPointerException si le String est null. + */ + public Set getGroupesOfEtudiant(Etudiant etu){ + throw new UnsupportedOperationException("pas encore implanté"); + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java new file mode 100644 index 0000000..cb9f56f --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java @@ -0,0 +1,63 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Une demande de changement de groupe + * concerne un étudiant, qui est dans un groupe A et veut aller dans un groupe B. + * + * Implémentation non persistante fournie avec l'API. + */ + +public class ChangementNP implements Changement { + + //auto-incrément des changements + private static int nextId=0; + + private int id; + private Groupe a,b; + private Etudiant e; + + public ChangementNP(Groupe a, Etudiant e, Groupe b){ + Objects.requireNonNull(a,"On ne peut pas créer un changement avec un groupe à quitter null"); + Objects.requireNonNull(b,"On ne peut pas créer un changement avec un groupe à rejoindre null"); + Objects.requireNonNull(e,"On ne peut pas créer un changement concernant un étudiant null"); + + this.id=++this.nextId; + this.a=a; + this.b=b; + this.e=e; + } + + /** + * permet de récupérer l'identifiant du changement (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer le groupe de depart + * @return ce groupe. + */ + public Groupe getA(){ + return this.a; + } + + /** + * permet de récupérer le groupe d'arrivée + * @return ce groupe. + */ + public Groupe getB(){ + return this.b; + } + + /** + * permet de récupérer l'étudiant demandant le changement + * @return cet étudiant + */ + public Etudiant getEtu(){ + return this.e; + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java~ new file mode 100644 index 0000000..ba98b21 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ChangementNP.java~ @@ -0,0 +1,60 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Une demande de changement de groupe + * concerne un étudiant, qui est dans un groupe A et veut aller dans un groupe B. + * + * Implémentation non persistante fournie avec l'API. + */ + +public class ChangementNP implements Changement { + + private int id; + private Groupe a,b; + private Etudiant e; + + public ChangementNP(Groupe a, Etudiant e, Groupe b){ + Objects.requireNonNull(a,"On ne peut pas créer un changement avec un groupe à quitter null"); + Objects.requireNonNull(b,"On ne peut pas créer un changement avec un groupe à rejoindre null"); + Objects.requireNonNull(e,"On ne peut pas créer un changement concernant un étudiant null"); + // Nous n'utilisons dans l'immédiat pas le champs id qui vaut 0 pour tous les changements. + this.id=0; + this.a=a; + this.b=b; + this.e=e; + } + + /** + * permet de récupérer l'identifiant du changement (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer le groupe de depart + * @return ce groupe. + */ + public Groupe getA(){ + return this.a; + } + + /** + * permet de récupérer le groupe d'arrivée + * @return ce groupe. + */ + public Groupe getB(){ + return this.a; + } + + /** + * permet de récupérer l'étudiant demandant le changement + * @return cet étudiant + */ + public Etudiant getEtu(){ + return this.e; + } + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java b/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java new file mode 100644 index 0000000..4d9df60 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java @@ -0,0 +1,51 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Un étudiant + */ + +public class EtudiantNP implements Etudiant{ + + private static int nextId=0; + private int id; + private String nom, prenom; + + /** + * Constructeur. + */ + public EtudiantNP(String nom, String prenom){ + Objects.requireNonNull(nom,"On ne peut pas créer un étudiant avec un nom null"); + Objects.requireNonNull(prenom,"On ne peut pas créer un étudiant avec un nom null"); + // auto incrément de l'id + this.id=++this.nextId; + this.nom=nom; + this.prenom=prenom; + } + + /** + * permet de récupérer l'identifiant de l'étudiant. + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer + * @return le nom de l'étudiant. + */ + public String getNom(){ + return this.nom; + } + + /** + * permet de récupérer + * @return le prénom de l'étudiant + */ + public String getPrenom(){ + return this.prenom; + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java~ new file mode 100644 index 0000000..2b6d0b9 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/EtudiantNP.java~ @@ -0,0 +1,51 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Un étudiant + */ + +public class EtudiantNP implements Etudiant{ + + private static nextId=0; + private int id; + private String nom, prenom; + + /** + * Constructeur. + */ + public EtudiantNP(String nom, String prenom){ + Objects.requireNonNull(nom,"On ne peut pas créer un étudiant avec un nom null"); + Objects.requireNonNull(prenom,"On ne peut pas créer un étudiant avec un nom null"); + // auto incrément de l'id + this.id=++this.nextId; + this.nom=nom; + this.prenom=prenom; + } + + /** + * permet de récupérer l'identifiant de l'étudiant. + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer + * @return le nom de l'étudiant. + */ + public String getNom(){ + return this.nom; + } + + /** + * permet de récupérer + * @return le prénom de l'étudiant + */ + public String getPrenom(){ + return this.prenom; + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java b/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java new file mode 100644 index 0000000..cefd3c7 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java @@ -0,0 +1,192 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Un groupe + */ + +public class GroupeNP implements Groupe { + + //auto-incrément des groupes. (NB. inutile, mais ça fair un exemple d'attribut statique). + private static int nextId=0; + // attributs naturels induits par getter de l'interface Groupe + private int id; + private String name; + private int min,max; + private TypeGroupe type; + private Groupe pointPoint; + // On utilise une interface set pour les sous-groupes et pour les membres (ce sont bien des ensembles en pratique). + private Set sousGroupes; + private Set membresDuGroupe; + + /** + * Nouveau groupe vide de type ROOT sans étudiants, sans sous-Groupe + */ + public GroupeNP(String name, int min, int max){ + Objects.requireNonNull(name,"On ne peut pas créer un groupe dont le nom est null"); + this.id=++this.nextId; + this.name=name; + this.min=min; + this.max=max; + this.type=TypeGroupe.ROOT; + this.pointPoint=this; + this.sousGroupes=new LinkedHashSet(); + this.membresDuGroupe=new LinkedHashSet(); + } + + /** + * Nouveau groupe vide de type FREE sans étudiants, sans sous-Groupe + */ + public GroupeNP(Groupe pere, String name, int min, int max){ + Objects.requireNonNull(pere,"On ne peut pas créer un groupe dont le père est null"); + Objects.requireNonNull(name,"On ne peut pas créer un groupe dont le nom est null"); + this.id=++this.nextId; + this.name=name; + this.min=min; + this.max=max; + this.type=TypeGroupe.FREE; + this.pointPoint=pere; + this.sousGroupes=new LinkedHashSet(); + this.membresDuGroupe=new LinkedHashSet(); + } + + /** + * Nouveau groupe de type PARTITION dupliquant le groupe passé en paramètre (pour servir de racine à une partition de ce groupe de type FREE passé en paramètre). + * + */ + public GroupeNP(Groupe pere){ + Objects.requireNonNull(pere,"On ne peut pas créer un groupe dont le père est null"); + this.id=++this.nextId; + this.name=pere.getName()+"_PARTITION_"+ this.id; + this.min=pere.getMin(); + this.max=pere.getMax(); + this.type=TypeGroupe.PARTITION; + this.pointPoint=pere; + this.sousGroupes= new LinkedHashSet(); + this.membresDuGroupe= pere.getEtudiants(); + } + + /** + * Ajoute un étudiant. Se comporte comme add de l'interface Set. + * + * @return true iff e est ajouté + */ + public boolean addEtudiant(Etudiant e){ + Objects.requireNonNull(e,"On ne peut pas ajouter un Étudiant qui est null"); + return this.membresDuGroupe.add(e); + } + + /** + * Enlève un étudiant. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + public boolean removeEtudiant(Etudiant e){ + Objects.requireNonNull(e,"On ne peut pas enlever un Étudiant qui est null"); + return this.membresDuGroupe.remove(e); + } + + /** + * Ajoute un sous-groupe. Se comporte comme add de l'interface Set. + * vérifie que le groupe passé en argument a bien renseigné this comme son père. + * + * @return true iff g est ajouté + */ + public boolean addSousGroupe(Groupe g){ + Objects.requireNonNull(g,"On ne peut pas ajouter un sous-groupe qui est null"); + if (this.equals(g.getPointPoint())) + return this.sousGroupes.add(g); + else throw new IllegalArgumentException("on ne peut pas ajouter un sous-groupe ont le père n'est pas this"); + } + + /** + * Enlève un groupe. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + public boolean removeSousGroupe(Groupe g){ + Objects.requireNonNull(g,"On ne peut pas enlever un Étudiant qui est null"); + return this.sousGroupes.remove(g); + } + + + /** + * permet de récupérer l'identifiant d'un groupe (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer le nom d'un groupe (utile irl). + * @return le nom. + */ + public String getName(){ + return this.name; + } + + /** + * permet de récupérer le nombre minimum d'étudiants souhaités dans le groupe. + * @return le minimum souhaité + */ + public int getMin(){ + return this.min; + } + + /** + * permet de récupérer le nombre maximum d'étudiants souhaités dans un groupe. + * @return le maximum souhaité + */ + public int getMax(){ + return this.max; + } + + /** + * permet de récupérer le nombre d'étudiants dans ce groupe. + * @return le nombre de places prises (pas forcément limité entre Min et Max, mais c'est le but) + */ + public int getSize(){ + return this.membresDuGroupe.size(); + } + + /** + * permet de récupérer la nature du groupe + * @return le type du groupe + */ + public TypeGroupe getType(){ + return type; + } + + /** + * permet de récupérer le groupe père + * un groupe racine devrait retourner lui-même + * + * @return le père + */ + public Groupe getPointPoint(){ + return this.pointPoint; + } + + /** + * Potentiellement "vide" + * Attention nous renvoyons l'ensemble sans le copier + * + * @return l'ensemble des sous-groupes. + */ + public Set getSousGroupes(){ + return this.sousGroupes; + } + + /** + * Potentiellement "vide" + * Attention nous renvoyons l'ensemble sans le copier + * + * @return l'ensemble des étudiants. + */ + public Set getEtudiants(){ + return this.membresDuGroupe; + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java~ new file mode 100644 index 0000000..e34daba --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/GroupeNP.java~ @@ -0,0 +1,199 @@ +package fr.iutfbleau.projetIHM2022FI2.MNP; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import java.util.*; +/** + * Un groupe + */ + +public class GroupeNP extends Groupe { + + //auto-incrément des groupes. (NB. inutile, mais ça fair un exemple d'attribut statique). + private static nextId=0; + // attributs naturels induits par getter de l'interface Groupe + private int id; + private String name; + private int min,max; + private TypeGroupe type; + private Groupe pointPoint; + // On utilise une interface set pour les sous-groupes et pour les membres (ce sont bien des ensembles en pratique). + private Set sousGroupes; + private Set membresDuGroupe; + + // les méthodes de l'interface groupe sont en fin de fichier. + // On commence par les get/set additionnels, puis les constructeurs. + + /** + * Réfléchir à donner droit dans paquet. + * @return le set des étudiants (attention ce n'est pas une copie, tout changement impacte le groupe). + */ + public Set getSetEtudiants(){ + return this.membresDuGroupe; + } + + /** + * Ajoute un étudiant. Se comporte comme add de l'interface Set. + * + * @return true iff e est ajouté + */ + package boolean addEtudiant(Etudiant e){ + Objects.requireNonNull(e,"On ne peut pas ajouter un Étudiant qui est null"); + return this.membresDuGroupe.add(e); + } + + /** + * Enlève un étudiant. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + package boolean removeEtudiant(Etudiant e){ + Objects.requireNonNull(e,"On ne peut pas enlever un Étudiant qui est null"); + return this.membresDuGroupe.remove(e); + } + + /** + * Ajoute un sous-groupe. Se comporte comme add de l'interface Set. + * vérifie que le groupe passé en argument a bien renseigné this comme son père. + * + * @return true iff g est ajouté + */ + package boolean addSousGroupe(Groupe g){ + Objects.requireNonNull(g,"On ne peut pas ajouter un sous-groupe qui est null"); + if (this.equals(g.getpointPoint())) + return this.sousGroupes.add(g); + else throw new IllegalArgumentException("on ne peut pas ajouter un sous-groupe ont le père n'est pas this"); + } + + /** + * Enlève un groupe. Se comporte comme remove de l'interface Set. + * + * @return true iff e est enlevé + */ + package boolean removeSousGroupe(Groupe g){ + Objects.requireNonNull(e,"On ne peut pas enlever un Étudiant qui est null"); + return this.souGroupes.remove(g); + } + + + /** + * Nouveau groupe vide de type PROMOTION sans étudiants, sans sous-Groupe + */ + public GroupeNP(String name, int min, int max){ + Objects.requireNonNull(name,"On ne peut pas créer un groupe dont le nom est null"); + this.id=++this.nextId; + this.name=name; + this.min=min; + this.max=max; + this.type=TypeGroupe.FREE; + this.pointPoint=this; + this.sousGroupes=new LinkedHashSet(); + this.membresDugroupe=new LinkedHashSet(); + } + + /** + * Nouveau groupe vide de type FREE sans étudiants, sans sous-Groupe + */ + public GroupeNP(Groupe pere, String name, int min, int max){ + Objects.requireNonNull(pere,"On ne peut pas créer un groupe dont le père est null"); + Objects.requireNonNull(name,"On ne peut pas créer un groupe dont le nom est null"); + this.id=++this.nextId; + this.name=name; + this.min=min; + this.max=max; + this.type=TypeGroupe.FREE; + this.pointPoint=pere; + this.sousGroupes=new LinkedHashSet(); + this.membresDugroupe=new LinkedHashSet(); + } + + /** + * Nouveau groupe de type PARTITION dupliquant le groupe passé en paramètre (pour servir de racine à une partition de ce groupe de type FREE passé en paramètre). + * + */ + public GroupeNP(Groupe pere){ + Objects.requireNonNull(pere,"On ne peut pas créer un groupe dont le père est null"); + this.id=++this.nextId; + this.name=pere.getName()+"_PARTITION_"+ this.id; + this.min=pere.getMin(); + this.max=pere.getMax(); + this.type=TypeGroupe.PARTITION; + this.pointPoint=pere; + this.sousGroupes= new LinkedHashSet(); + this.membresDugroupe= this.pere.getSetEtudiants(); + } + + /** + * permet de récupérer l'identifiant d'un groupe (référence interne sans intérêt irl). + * @return l'identifiant. + */ + public int getId(){ + return this.id; + } + + /** + * permet de récupérer le nom d'un groupe (utile irl). + * @return le nom. + */ + public String getName(){ + return this.name; + } + + /** + * permet de récupérer le nombre minimum d'étudiants souhaités dans le groupe. + * @return le minimum souhaité + */ + public int getMin(){ + return this.min; + } + + /** + * permet de récupérer le nombre maximum d'étudiants souhaités dans un groupe. + * @return le maximum souhaité + */ + public int getMax(){ + return this.max; + } + + /** + * permet de récupérer le nombre d'étudiants dans ce groupe. + * @return le nombre de places prises (pas forcément limité entre Min et Max, mais c'est le but) + */ + public int getSize(){ + return this.membresDuGroupe.size(); + } + + /** + * permet de récupérer la nature du groupe + * @return le type du groupe + */ + public TypeGroupe getType(){ + return type; + } + + /** + * permet de récupérer le groupe père + * un groupe racine devrait retourner lui-même + * + * @return le père + */ + public Groupe getPointPoint(){ + return this.pointPoint; + } + + /** + * Potentiellement "vide" + * @return un itérateur sur sous-groupes. + */ + public Iterator getSousGroupes(){ + return this.sousGroupes.iterator(); + } + + /** + * Potentiellement "vide" + * @return un itérateur sur les étudiants. + */ + public Iterator getEtudiants(){ + return this.membresDuGroupe.iterator(); + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/MNP/ReservationFactoryNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ReservationFactoryNP.java~ new file mode 100644 index 0000000..a4a4d99 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/MNP/ReservationFactoryNP.java~ @@ -0,0 +1,164 @@ +package fr.iutfbleau.projetIHM2021FI2.MNP; +import fr.iutfbleau.projetIHM2021FI2.API.*; +import java.time.LocalDate; +import java.util.*; +import java.util.function.Predicate; +/** + * Usine non persistante stockant les réservations dans une structure de données permettant de simuler un ensemble. + * + * + */ +public interface ReservationFactory{ + + /** + * Recherche une chambre adéquate à partir de + * @param p une préréservation + * @return la chambre + * @throws NullPointerException si un argument est null + * @throws IllegalStateException si une chambre correspondant à cette Préréservation n'existe pas. + * + * Ne devrait pas retourner un objet null. + */ + public Chambre getChambre(Prereservation p); + + /** + * Recherche toutes les chambres adéquates à partir de + * @param p une préréservation + * @return les chambres (set de chambre) + * @throws NullPointerException si un argument est null + * @throws IllegalStateException si une chambre correspondant à cette Préréservation n'existe pas. + * + * Ne devrait pas retourner un objet null. + */ + public Set getChambres(Prereservation p); + + /** + * Fabrique (ajoute) une réservation + * @param p une préréservation + * @param c une chambre (normalement libre et adaptée à la préréservation) + * @return la réservation + * @throws NullPointerException si un argument est null + * @throws IllegalArgumentException si la chambre ne correspondant pas au type de chambre de la préréservation. + * @throws IllegalStateException si la chambre n'est pas disponible. + * + * Ne devrait pas retourner un objet null. + */ + public Reservation createReservation(Prereservation p, Chambre c); + + /** + * Cherche les réservations + * @param d une date + * @return la ou les réservation(s) à cette date sous forme d'un ensemble + * @throws NullPointerException si un argument est null + * + * Ne devrait pas retourner un objet null, par contre peut être un ensemble qui est vide. + */ + public Set getReservation(LocalDate d); + + /** + * Cherche le nombre de chambres disponibles pour une date (réservées ou non). + * @param d une date + * @return un entier + * @throws NullPointerException si un argument est null + * + * Ne devrait pas retourner un entier négatif. + */ + public int getDisponibles(LocalDate d); + + /** + * Cherche les réservations + * @param d une date + * @param t un type de chambre + * @return la ou les réservation(s) pour ce type de chambre à cette date sous forme d'un ensemble + * @throws NullPointerException si un argument est null + * + * Ne devrait pas retourner un objet null, par contre peut être un ensemble qui est vide. + */ + public Set getReservation(LocalDate d, TypeChambre t); + + /** + * Cherche le nombre de chambres disponibles d'un certain type pour une date (réservées ou non). + * @param d une date + * @param t un type de chambre + * @return un entier + * @throws NullPointerException si un argument est null + * + * Ne devrait pas retourner un entier négatif. + */ + public int getDisponibles(LocalDate d, TypeChambre t); + + /** + * Cherche la proportion de chambres disponibles pour une date (réservées sur réservables). + * @param d une date + * @return un entier entre 0 et 100 + * @throws NullPointerException si un argument est null + */ + public int getRatio(LocalDate d); + + /** + * Cherche la proportion de chambres disponibles d'un certain type pour une date (réservées sur réservables). + * @param d une date + * @param t un type de chambre + * @return un entier entre 0 et 100 + * @throws NullPointerException si un argument est null + */ + public int getRatio(LocalDate d, TypeChambre t); + + /** + * Cherche le nombre moyen de chambres disponibles entre deux date (réservées ou non), arrondies à l'entier inférieur. + * @param d1 une date + * @param d2 une date + * @return un entier + * @throws NullPointerException si un argument est null + * @throws IllegalArgumentException si l'ordre temporel d1 avant d2 n'est pas respecté. + * + * Ne devrait pas retourner un entier négatif. + */ + public int getDisponibles(LocalDate d1, LocalDate d2); + + /** + * Cherche les réservations + * @param d1 une date + * @param d2 une date + * @param t un type de chambre + * @return la ou les réservation(s) pour ce type de chambre entre les dates sous forme d'un ensemble + * @throws NullPointerException si un argument est null + * @throws IllegalArgumentException si l'ordre temporel d1 avant d2 n'est pas respecté. + * + * Ne devrait pas retourner un objet null, par contre peut être un ensemble qui est vide. + */ + public Set getReservation(LocalDate d1, LocalDate d2, TypeChambre t); + + /** + * Cherche le nombre moyen de chambres disponibles d'un certain type entre deux date (réservées ou non), arrondies à l'entier inférieur. + * @param d1 une date + * @param d2 une date + * @param t un type de chambre + * @return un entier + * @throws NullPointerException si un argument est null + * @throws IllegalArgumentException si l'ordre temporel d1 avant d2 n'est pas respecté. + * + * Ne devrait pas retourner un entier négatif. + */ + public int getDisponibles(LocalDate d1, LocalDate d2, TypeChambre t); + + /** + * Cherche la proportion moyenne de chambres disponibles pour une date (réservées sur réservables). + * @param d1 une date + * @param d2 une date + * @return un entier entre 0 et 100 + * @throws NullPointerException si un argument est null + */ + public int getRatio(LocalDate d1, LocalDate d2); + + /** + * Cherche la proportion moyenne de chambres disponibles d'un certain type pour une date (réservées sur réservables). + * @param d1 une date + * @param d2 une date + * @param t un type de chambre + * @return un entier entre 0 et 100 + * @throws NullPointerException si un argument est null + */ + public int getRatio(LocalDate d1, LocalDate d2, TypeChambre t); + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java b/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java new file mode 100644 index 0000000..15f8436 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java @@ -0,0 +1,236 @@ +package fr.iutfbleau.projetIHM2022FI2.Test; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import fr.iutfbleau.projetIHM2022FI2.MNP.*; +import java.util.*; +//import java.util.Random; + +public class TestTexteMNP{ + + + public static void main(String[] args) { + // morceaux de modèle + + // Notez que à gauche d'une déclaration on utilise une interface et à droite une version concrète. + // Il faut que votre vue se calque sur le fonctionnemment de ce main et ne fasse pas d'hypothèse sur l'implémentation concrète de l'interface. + // i.e. entre les versions non persistantes (qui terminent par NP) et votre implémentation éventuelle persistante, le seul changement de comportement devrait être la persistance. + // + + System.out.println("Test de l\'API"); + System.out.print("Création des étudiants"); + + Etudiant e1=new EtudiantNP("césar","lycurgus"); + Etudiant e2=new EtudiantNP("denis","uranus"); + Etudiant e3=new EtudiantNP("marcel","castor"); + Etudiant e4=new EtudiantNP("marin","eurydice"); + Etudiant e5=new EtudiantNP("constantin","akoni"); + Etudiant e6=new EtudiantNP("donat","anakoni"); + Etudiant e7=new EtudiantNP("alexandre","apikalia"); + Etudiant e8=new EtudiantNP("andré","ekewaka"); + Etudiant e9=new EtudiantNP("renard","elikapeka"); + Etudiant e10=new EtudiantNP("achille","haukea"); + + System.out.print("."); + + Etudiant e11=new EtudiantNP("agathe","iakopa"); + Etudiant e12=new EtudiantNP("sabine","spartacus"); + Etudiant e13=new EtudiantNP("michel","caligula"); + Etudiant e14=new EtudiantNP("marthe","alaric"); + Etudiant e15=new EtudiantNP("juliane","hannibal"); + Etudiant e16=new EtudiantNP("anne","juvenal"); + Etudiant e17=new EtudiantNP("sophie","bede"); + Etudiant e18=new EtudiantNP("louis","hamilcar"); + Etudiant e19=new EtudiantNP("diane","ladislas"); + Etudiant e20=new EtudiantNP("christine","mahatma"); + + System.out.print("."); + + Etudiant e21=new EtudiantNP("francine","napoleon"); + Etudiant e22=new EtudiantNP("louise","lalita"); + Etudiant e23=new EtudiantNP("chantal","laxman"); + Etudiant e24=new EtudiantNP("giselle","laxmi"); + Etudiant e25=new EtudiantNP("caroline","leela"); + Etudiant e26=new EtudiantNP("claude","lila"); + Etudiant e27=new EtudiantNP("pauline","lilavati"); + Etudiant e28=new EtudiantNP("avril","lochan"); + Etudiant e29=new EtudiantNP("jacqueline","madhav"); + Etudiant e30=new EtudiantNP("denise","turlough"); + + System.out.print("."); + + Etudiant e31=new EtudiantNP("gabrielle","uaithne"); + Etudiant e32=new EtudiantNP("julie","uilleag"); + Etudiant e33=new EtudiantNP("madeleine","uilliam"); + Etudiant e34=new EtudiantNP("charlotte","uinseann"); + Etudiant e35=new EtudiantNP("bertrand","ulick"); + Etudiant e36=new EtudiantNP("lucile","ultan"); + Etudiant e37=new EtudiantNP("nicole","firdaus"); + Etudiant e38=new EtudiantNP("blanche","yasmin"); + Etudiant e39=new EtudiantNP("jeanine","javed"); + Etudiant e40=new EtudiantNP("roxane","naveed"); + + System.out.print("."); + + Etudiant e41=new EtudiantNP("adeline","shahnaz"); + Etudiant e42=new EtudiantNP("dion","ardashir"); + Etudiant e43=new EtudiantNP("liane","atefeh"); + Etudiant e44=new EtudiantNP("myriam","luigina"); + Etudiant e45=new EtudiantNP("danielle","luigino"); + Etudiant e46=new EtudiantNP("arlette","maddalena"); + Etudiant e47=new EtudiantNP("michelle","manfredo"); + Etudiant e48=new EtudiantNP("justine","manlio"); + Etudiant e49=new EtudiantNP("natalie","marcellino"); + Etudiant e50=new EtudiantNP("aline","mariangela"); + + System.out.print("."); + + Etudiant e51=new EtudiantNP("prosper","marzio"); + Etudiant e52=new EtudiantNP("mirabelle","massimiliano"); + Etudiant e53=new EtudiantNP("carine","matteo"); + Etudiant e54=new EtudiantNP("jeannine","melchiorre"); + Etudiant e55=new EtudiantNP("dianne","micaela"); + Etudiant e56=new EtudiantNP("evette","michela"); + Etudiant e57=new EtudiantNP("gisselle","michelangela"); + + System.out.println("terminé."); + + System.out.print("Création de l\'usine à groupe"); + AbstractGroupeFactory agf = new AbstractGroupeFactoryNP("BUT2 FI", 15, 92); + System.out.println("terminé."); + + System.out.print("Création de l\'usine à changement"); + AbstractChangementFactory acf = new AbstractChangementFactoryNP(agf); + System.out.println("terminé."); + + System.out.print("Ajout des étudiants dans le groupe de la promotion racine"); + + agf.addToGroupe(agf.getPromotion(),e1); + agf.addToGroupe(agf.getPromotion(),e2); + agf.addToGroupe(agf.getPromotion(),e3); + agf.addToGroupe(agf.getPromotion(),e4); + agf.addToGroupe(agf.getPromotion(),e5); + agf.addToGroupe(agf.getPromotion(),e6); + agf.addToGroupe(agf.getPromotion(),e7); + agf.addToGroupe(agf.getPromotion(),e8); + agf.addToGroupe(agf.getPromotion(),e9); + agf.addToGroupe(agf.getPromotion(),e10); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e11); + agf.addToGroupe(agf.getPromotion(),e12); + agf.addToGroupe(agf.getPromotion(),e13); + agf.addToGroupe(agf.getPromotion(),e14); + agf.addToGroupe(agf.getPromotion(),e15); + agf.addToGroupe(agf.getPromotion(),e16); + agf.addToGroupe(agf.getPromotion(),e17); + agf.addToGroupe(agf.getPromotion(),e18); + agf.addToGroupe(agf.getPromotion(),e19); + agf.addToGroupe(agf.getPromotion(),e20); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e21); + agf.addToGroupe(agf.getPromotion(),e22); + agf.addToGroupe(agf.getPromotion(),e23); + agf.addToGroupe(agf.getPromotion(),e24); + agf.addToGroupe(agf.getPromotion(),e25); + agf.addToGroupe(agf.getPromotion(),e26); + agf.addToGroupe(agf.getPromotion(),e27); + agf.addToGroupe(agf.getPromotion(),e28); + agf.addToGroupe(agf.getPromotion(),e29); + agf.addToGroupe(agf.getPromotion(),e30); + agf.addToGroupe(agf.getPromotion(),e31); + agf.addToGroupe(agf.getPromotion(),e32); + agf.addToGroupe(agf.getPromotion(),e33); + agf.addToGroupe(agf.getPromotion(),e34); + agf.addToGroupe(agf.getPromotion(),e35); + agf.addToGroupe(agf.getPromotion(),e36); + agf.addToGroupe(agf.getPromotion(),e37); + agf.addToGroupe(agf.getPromotion(),e38); + agf.addToGroupe(agf.getPromotion(),e39); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e40); + agf.addToGroupe(agf.getPromotion(),e41); + agf.addToGroupe(agf.getPromotion(),e42); + agf.addToGroupe(agf.getPromotion(),e43); + agf.addToGroupe(agf.getPromotion(),e44); + agf.addToGroupe(agf.getPromotion(),e45); + agf.addToGroupe(agf.getPromotion(),e46); + agf.addToGroupe(agf.getPromotion(),e47); + agf.addToGroupe(agf.getPromotion(),e48); + agf.addToGroupe(agf.getPromotion(),e49); + agf.addToGroupe(agf.getPromotion(),e50); + agf.addToGroupe(agf.getPromotion(),e51); + agf.addToGroupe(agf.getPromotion(),e52); + agf.addToGroupe(agf.getPromotion(),e53); + agf.addToGroupe(agf.getPromotion(),e54); + agf.addToGroupe(agf.getPromotion(),e55); + agf.addToGroupe(agf.getPromotion(),e56); + agf.addToGroupe(agf.getPromotion(),e57); + System.out.println("terminé."); + + System.out.println("Initialisation complète."); + + System.out.println("=========================="); + System.out.println("Le groupe promotion"); + System.out.println(agf.getPromotion().monPrint()); + + System.out.println("=========================="); + System.out.println("Partition du groupe racine en 3 groupes TD."); + agf.createPartition(agf.getPromotion(), "TD",4); + //System.out.println(agf.getPromotion().monPrint()); + + Groupe racineDeLaPartition = agf.getPromotion().getSousGroupes().iterator().next(); + System.out.println(racineDeLaPartition.monPrint()); + + System.out.println("== Cette version ajoute les étudiants automatiquement pour une partition "); + for(Groupe g : racineDeLaPartition.getSousGroupes()){ + System.out.println(g.monPrint()); + } + + System.out.println("=========================="); + System.out.println("Création d'un changement"); + Iterator itgr = racineDeLaPartition.getSousGroupes().iterator(); + Groupe A = itgr.next(); // premier sous-groupe + Groupe B = itgr.next(); // second sous-groupe + B = itgr.next(); // troisième sous-groupe + Etudiant e = A.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe. + acf.createChangement(A,e,B); + System.out.println("Récupération des changements (en fait un seul pour l'instant)"); + Iterator itch = acf.getAllChangements().iterator(); + Changement c = itch.next(); + System.out.println(c.monPrint()); + System.out.println("Application du changement"); + acf.applyChangement(c); + System.out.println("=========================="); + System.out.println("== nouveau contenu des groupes de la partition "); + for(Groupe g : racineDeLaPartition.getSousGroupes()){ + System.out.println(g.monPrint()); + } + + System.out.println("=========================="); + System.out.println("Création de 2 changements"); + itgr = racineDeLaPartition.getSousGroupes().iterator(); + A = itgr.next(); // premier sous-groupe + B = itgr.next(); // second sous-groupe + Etudiant etu1 = A.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe. + Etudiant etu2 = B.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe. + acf.createChangement(A,etu1,B); + acf.createChangement(B,etu2,A); + // Impression des changements. + for (Changement cgt : acf.getAllChangements()){ + System.out.println(cgt.monPrint()); + } + itch = acf.getAllChangements().iterator(); + c = itch.next(); + System.out.println("Suppression d'un changement. Il reste :"); + acf.deleteChangement(itch.next()); + for (Changement cgt : acf.getAllChangements()){ + System.out.println(cgt.monPrint()); + } + } + + +} diff --git a/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java~ b/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java~ new file mode 100644 index 0000000..d48a176 --- /dev/null +++ b/src/fr/iutfbleau/projetIHM2022FI2/Test/TestTexteMNP.java~ @@ -0,0 +1,218 @@ +package fr.iutfbleau.projetIHM2022FI2.Test; +import fr.iutfbleau.projetIHM2022FI2.API.*; +import fr.iutfbleau.projetIHM2022FI2.MNP.*; +import java.util.*; +//import java.util.Random; + +public class TestTexteMNP{ + + + public static void main(String[] args) { + // morceaux de modèle + + // Notez que à gauche d'une déclaration on utilise une interface et à droite une version concrète. + // Il faut que votre vue se calque sur le fonctionnemment de ce main et ne fasse pas d'hypothèse sur l'implémentation concrète de l'interface. + // i.e. entre les versions non persistantes (qui terminent par NP) et votre implémentation éventuelle persistante, le seul changement de comportement devrait être la persistance. + // + + System.out.println("Test de l\'API"); + System.out.print("Création des étudiants"); + + Etudiant e1=new EtudiantNP("césar","lycurgus"); + Etudiant e2=new EtudiantNP("denis","uranus"); + Etudiant e3=new EtudiantNP("marcel","castor"); + Etudiant e4=new EtudiantNP("marin","eurydice"); + Etudiant e5=new EtudiantNP("constantin","akoni"); + Etudiant e6=new EtudiantNP("donat","anakoni"); + Etudiant e7=new EtudiantNP("alexandre","apikalia"); + Etudiant e8=new EtudiantNP("andré","ekewaka"); + Etudiant e9=new EtudiantNP("renard","elikapeka"); + Etudiant e10=new EtudiantNP("achille","haukea"); + + System.out.print("."); + + Etudiant e11=new EtudiantNP("agathe","iakopa"); + Etudiant e12=new EtudiantNP("sabine","spartacus"); + Etudiant e13=new EtudiantNP("michel","caligula"); + Etudiant e14=new EtudiantNP("marthe","alaric"); + Etudiant e15=new EtudiantNP("juliane","hannibal"); + Etudiant e16=new EtudiantNP("anne","juvenal"); + Etudiant e17=new EtudiantNP("sophie","bede"); + Etudiant e18=new EtudiantNP("louis","hamilcar"); + Etudiant e19=new EtudiantNP("diane","ladislas"); + Etudiant e20=new EtudiantNP("christine","mahatma"); + + System.out.print("."); + + Etudiant e21=new EtudiantNP("francine","napoleon"); + Etudiant e22=new EtudiantNP("louise","lalita"); + Etudiant e23=new EtudiantNP("chantal","laxman"); + Etudiant e24=new EtudiantNP("giselle","laxmi"); + Etudiant e25=new EtudiantNP("caroline","leela"); + Etudiant e26=new EtudiantNP("claude","lila"); + Etudiant e27=new EtudiantNP("pauline","lilavati"); + Etudiant e28=new EtudiantNP("avril","lochan"); + Etudiant e29=new EtudiantNP("jacqueline","madhav"); + Etudiant e30=new EtudiantNP("denise","turlough"); + + System.out.print("."); + + Etudiant e31=new EtudiantNP("gabrielle","uaithne"); + Etudiant e32=new EtudiantNP("julie","uilleag"); + Etudiant e33=new EtudiantNP("madeleine","uilliam"); + Etudiant e34=new EtudiantNP("charlotte","uinseann"); + Etudiant e35=new EtudiantNP("bertrand","ulick"); + Etudiant e36=new EtudiantNP("lucile","ultan"); + Etudiant e37=new EtudiantNP("nicole","firdaus"); + Etudiant e38=new EtudiantNP("blanche","yasmin"); + Etudiant e39=new EtudiantNP("jeanine","javed"); + Etudiant e40=new EtudiantNP("roxane","naveed"); + + System.out.print("."); + + Etudiant e41=new EtudiantNP("adeline","shahnaz"); + Etudiant e42=new EtudiantNP("dion","ardashir"); + Etudiant e43=new EtudiantNP("liane","atefeh"); + Etudiant e44=new EtudiantNP("myriam","luigina"); + Etudiant e45=new EtudiantNP("danielle","luigino"); + Etudiant e46=new EtudiantNP("arlette","maddalena"); + Etudiant e47=new EtudiantNP("michelle","manfredo"); + Etudiant e48=new EtudiantNP("justine","manlio"); + Etudiant e49=new EtudiantNP("natalie","marcellino"); + Etudiant e50=new EtudiantNP("aline","mariangela"); + + System.out.print("."); + + Etudiant e51=new EtudiantNP("prosper","marzio"); + Etudiant e52=new EtudiantNP("mirabelle","massimiliano"); + Etudiant e53=new EtudiantNP("carine","matteo"); + Etudiant e54=new EtudiantNP("jeannine","melchiorre"); + Etudiant e55=new EtudiantNP("dianne","micaela"); + Etudiant e56=new EtudiantNP("evette","michela"); + Etudiant e57=new EtudiantNP("gisselle","michelangela"); + + System.out.println("terminé."); + + System.out.print("Création de l\'usine à groupe"); + AbstractGroupeFactory agf = new AbstractGroupeFactoryNP("BUT2 FI", 15, 92); + System.out.println("terminé."); + + System.out.print("Création de l\'usine à changement"); + AbstractChangementFactory acf = new AbstractChangementFactoryNP(agf); + System.out.println("terminé."); + + System.out.print("Ajout des étudiants dans le groupe de la promotion racine"); + + agf.addToGroupe(agf.getPromotion(),e1); + agf.addToGroupe(agf.getPromotion(),e2); + agf.addToGroupe(agf.getPromotion(),e3); + agf.addToGroupe(agf.getPromotion(),e4); + agf.addToGroupe(agf.getPromotion(),e5); + agf.addToGroupe(agf.getPromotion(),e6); + agf.addToGroupe(agf.getPromotion(),e7); + agf.addToGroupe(agf.getPromotion(),e8); + agf.addToGroupe(agf.getPromotion(),e9); + agf.addToGroupe(agf.getPromotion(),e10); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e11); + agf.addToGroupe(agf.getPromotion(),e12); + agf.addToGroupe(agf.getPromotion(),e13); + agf.addToGroupe(agf.getPromotion(),e14); + agf.addToGroupe(agf.getPromotion(),e15); + agf.addToGroupe(agf.getPromotion(),e16); + agf.addToGroupe(agf.getPromotion(),e17); + agf.addToGroupe(agf.getPromotion(),e18); + agf.addToGroupe(agf.getPromotion(),e19); + agf.addToGroupe(agf.getPromotion(),e20); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e21); + agf.addToGroupe(agf.getPromotion(),e22); + agf.addToGroupe(agf.getPromotion(),e23); + agf.addToGroupe(agf.getPromotion(),e24); + agf.addToGroupe(agf.getPromotion(),e25); + agf.addToGroupe(agf.getPromotion(),e26); + agf.addToGroupe(agf.getPromotion(),e27); + agf.addToGroupe(agf.getPromotion(),e28); + agf.addToGroupe(agf.getPromotion(),e29); + agf.addToGroupe(agf.getPromotion(),e30); + agf.addToGroupe(agf.getPromotion(),e31); + agf.addToGroupe(agf.getPromotion(),e32); + agf.addToGroupe(agf.getPromotion(),e33); + agf.addToGroupe(agf.getPromotion(),e34); + agf.addToGroupe(agf.getPromotion(),e35); + agf.addToGroupe(agf.getPromotion(),e36); + agf.addToGroupe(agf.getPromotion(),e37); + agf.addToGroupe(agf.getPromotion(),e38); + agf.addToGroupe(agf.getPromotion(),e39); + + System.out.print("."); + + agf.addToGroupe(agf.getPromotion(),e40); + agf.addToGroupe(agf.getPromotion(),e41); + agf.addToGroupe(agf.getPromotion(),e42); + agf.addToGroupe(agf.getPromotion(),e43); + agf.addToGroupe(agf.getPromotion(),e44); + agf.addToGroupe(agf.getPromotion(),e45); + agf.addToGroupe(agf.getPromotion(),e46); + agf.addToGroupe(agf.getPromotion(),e47); + agf.addToGroupe(agf.getPromotion(),e48); + agf.addToGroupe(agf.getPromotion(),e49); + agf.addToGroupe(agf.getPromotion(),e50); + agf.addToGroupe(agf.getPromotion(),e51); + agf.addToGroupe(agf.getPromotion(),e52); + agf.addToGroupe(agf.getPromotion(),e53); + agf.addToGroupe(agf.getPromotion(),e54); + agf.addToGroupe(agf.getPromotion(),e55); + agf.addToGroupe(agf.getPromotion(),e56); + agf.addToGroupe(agf.getPromotion(),e57); + System.out.println("terminé."); + + System.out.println("Initialisation complète."); + + System.out.println("=========================="); + System.out.println("Le groupe promotion"); + System.out.println(agf.getPromotion().monPrint()); + + System.out.println("=========================="); + System.out.println("Partition du groupe racine en 3 groupes TD."); + agf.createPartition(agf.getPromotion(), "TD",4); + //System.out.println(agf.getPromotion().monPrint()); + + Groupe racineDeLaPartition = agf.getPromotion().getSousGroupes().iterator().next(); + System.out.println(racineDeLaPartition.monPrint()); + + System.out.println("== Cette version ajoute les étudiants automatiquement pour une partition "); + for(Groupe g : racineDeLaPartition.getSousGroupes()){ + System.out.println(g.monPrint()); + } + + System.out.println("=========================="); + System.out.println("Création d'un changement"); + Iterator itgr = racineDeLaPartition.getSousGroupes().iterator(); + Groupe A = itgr.next(); // premier sous-groupe + Groupe B = itgr.next(); // second sous-groupe + B = itgr.next(); // troisième sous-groupe + System.out.println("== debug =="); + System.out.println(A.getName()); + System.out.println(B.getName()); + Etudiant e = A.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe. + acf.createChangement(A,e,B); + System.out.println("Récupération des changements (en fait un seul pour l'instant)"); + Iterator itch = acf.getAllChangements().iterator(); + Changement c = itch.next(); + System.out.println(c.monPrint()); + System.out.println("Application du changement"); + acf.applyChangement(c); + System.out.println("=========================="); + System.out.println("== nouveau contenu des groupes de la partition "); + for(Groupe g : racineDeLaPartition.getSousGroupes()){ + System.out.println(g.monPrint()); + } + } + + +}