Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
}
public void afficher() {
+ String className = this.getClass().getSimpleName();
+ System.out.println("---- " + className + " ----");
for (int i = 0; i < formeNumber; i++) {
formeCollection[i].afficher();
}
}
public void compacter(int nElements) {
- for (int i = formeNumber - 1; (i > formeNumber - nElements && !isEmpty()); i--) {
+ int minIndex = formeNumber - nElements - 1;
+ for (int i = formeNumber - 1; (i > minIndex && !isEmpty()); i--) {
supprimer(i);
}
}
liste.inserer(4);
for (int i = 0; i < 10; i++) {
- structure[i] = entier;
+ structure[i] = entiers;
structure[i].afficher();
structure[i].compacter(1);
structure[i].afficher();
structure[i].afficher();
structure[i].compacter(1);
structure[i].afficher();
-
- structure[i] = image;
- structure[i].afficher();
- structure[i].compacter(1);
- structure[i].afficher();
}
+
+ image.afficher();
+ image.compacter(1);
+ image.afficher();
}
public static void main(String[] args) {