Skip to content
Snippets Groups Projects
Commit f68edfac authored by Thomas Lapp's avatar Thomas Lapp
Browse files

ajout de main plus modification de déclaration de tableauStd

parent 236b0c39
No related merge requests found
package p4a;
public class MainArrayListStdAddFin {
public static void main(String[] args) {
ArrayListStd<Integer> arrayListStd = new ArrayListStd<Integer>();
int nbOperation = Integer.parseInt(args[0]);
for (int i = 0; i < nbOperation; i++) {
arrayListStd.ajout(0, i);
}
}
}
package p4a;
public class MainLinkedListPersoAddFin {
public static void main(String[] args) {
LinkedListPerso<Integer> linkedListStd = new LinkedListPerso<Integer>();
int nbOperation = Integer.parseInt(args[0]);
for (int i = 0; i < nbOperation; i++) {
linkedListStd.ajout(0, i);
}
}
}
package p4a;
public class MainLinkedListStdAddFin {
public static void main(String[] args) {
LinkedListStd<Integer> linkedListStd = new LinkedListStd<Integer>();
int nbOperation = Integer.parseInt(args[0]);
for (int i = 0; i < nbOperation; i++) {
linkedListStd.ajout(0, i);
}
}
}
package p4a;
public class MainTableauPersoAdd {
public static void main(String[] args) {
int nbOperation = Integer.parseInt(args[0]);
TableauPerso tabStd = new TableauPerso(nbOperation);
for (int i = 0; i < nbOperation; i++) {
tabStd.ajout(0, i);
}
}
}
package p4a;
public class MainTableauStdAdd {
public static void main(String[] args) {
int nbOperation = Integer.parseInt(args[0]);
TableauStd tabStd = new TableauStd(nbOperation);
for (int i = 0; i < nbOperation; i++) {
tabStd.ajout(0, i);
}
}
}
...@@ -49,6 +49,4 @@ public class TableauPerso implements Structure{ ...@@ -49,6 +49,4 @@ public class TableauPerso implements Structure{
} }
} }
...@@ -4,8 +4,11 @@ public class TableauStd implements Structure { ...@@ -4,8 +4,11 @@ public class TableauStd implements Structure {
private Object[] tableau; private Object[] tableau;
public TableauStd(Object[] tableau) { public TableauStd(int taille) {
this.tableau = tableau; if (taille < 0) {
throw new IllegalArgumentException("TableauStd : taille negative " + taille);
}
this.tableau = new Object[taille];
} }
@Override @Override
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment