modification déclaration hashmap dans Commande

This commit is contained in:
sio 2024-09-12 10:11:11 +02:00
parent 8543fbf45b
commit 0f472d5df2
4 changed files with 103 additions and 97 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
Libraries/* Libraries/*
Test Libraries/* Test Libraries/*
/nbproject/private/ /nbproject/private/
/build/

View File

@ -71,7 +71,7 @@ jlink.additionalmodules=
jlink.additionalparam= jlink.additionalparam=
jlink.launcher=true jlink.launcher=true
jlink.launcher.name=MusicAndCo jlink.launcher.name=MusicAndCo
main.class= main.class=Test
manifest.file=manifest.mf manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false mkdist.disabled=false

View File

@ -25,6 +25,8 @@ public class Test {
Commande laCommande = new Commande(1,1,"12/09/2024"); Commande laCommande = new Commande(1,1,"12/09/2024");
lEntreprise.ajouterCommande(laCommande); lEntreprise.ajouterCommande(laCommande);
//Ajouter à la commande une ligne de 2 instr1
laCommande.ajouter(instr1, 2);
} }
} }

View File

@ -5,8 +5,10 @@
package métiers; package métiers;
import java.util.Objects;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/** /**
* *
* @author ilona * @author ilona
@ -15,9 +17,10 @@ public class Commande {
private int noCom, noVendeur; private int noCom, noVendeur;
private String dateCom; private String dateCom;
private HashMap <Instrument, int> lesLignes = new HashMap();
private final HashMap<Instrument, Integer> lesLignes = new HashMap<>();
public Commande(int noCom, int noVendeur, String dateCom) { public Commande(int noCom, int noVendeur, String dateCom) {
this.noCom = noCom; this.noCom = noCom;