From: Jérôme Benoit Date: Fri, 16 Feb 2018 08:59:58 +0000 (+0100) Subject: Add Affichable interface. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9cc8a5bc2cccbac53277616f500cee25dbc606a4;p=TP_POO.git Add Affichable interface. Signed-off-by: Jérôme Benoit --- diff --git a/Entiers/Entiers.java b/Entiers/Entiers.java index adcc822..4f1168e 100644 --- a/Entiers/Entiers.java +++ b/Entiers/Entiers.java @@ -60,6 +60,7 @@ class Entiers { private int binarySearch(int first, int last, int value) { if (last < first) + //FIXME: should not return an integer return -1; int middle = (first + last) / 2; if (value == int_array[middle]) diff --git a/Structure/Entiers.java b/Structure/Entiers.java index 4abf4f0..b4cffb1 100644 --- a/Structure/Entiers.java +++ b/Structure/Entiers.java @@ -60,6 +60,7 @@ class Entiers extends Structure { private int binarySearch(int first, int last, int value) { if (last < first) + //FIXME: should not return an integer return -1; int middle = (first + last) / 2; if (value == int_array[middle]) diff --git a/TP2/Affichable.java b/TP2/Affichable.java new file mode 100644 index 0000000..2b77230 --- /dev/null +++ b/TP2/Affichable.java @@ -0,0 +1,6 @@ + +public interface Affichable { + + public void afficher(); + +} diff --git a/TP2/Makefile b/TP2/Makefile index 41023ff..ddd7c4c 100644 --- a/TP2/Makefile +++ b/TP2/Makefile @@ -47,6 +47,8 @@ JVM = java CLASSES = \ Point.java \ + Affichable.java \ + Structure.java \ Forme.java \ Image.java \ Segment.java \ diff --git a/TP2/Piletransformations.java b/TP2/Piletransformations.java index 6d25095..5e53ddd 100644 --- a/TP2/Piletransformations.java +++ b/TP2/Piletransformations.java @@ -52,7 +52,7 @@ class Piletransformations { public void display() { System.out.println("----"); - for (int i = 0; i < transformations.length; i++) { + for (int i = 0; i < currentTransformation; i++) { System.out.println(transformations[i].toString()); } } diff --git a/TP2/Structure.java b/TP2/Structure.java new file mode 100644 index 0000000..170928f --- /dev/null +++ b/TP2/Structure.java @@ -0,0 +1,7 @@ + +public abstract class Structure { + + public abstract boolean inserer(int value); + public abstract boolean supprimer(int value); + +}